I'm trying to build a javascript that will autocomplete a textfield based off of a customer name in an array, but I would also like to set a hidden field to the customer ID. Im not sure how to build an associative array that will allow me to accomplish this. I've found a bunch of sniplets for autocomplete, but I'm struggling on how to build the array and subsequently referencing it to set 2 html tags:
<SCRIPT language="JavaScript">
function autocomplete(filter)
{
var filter = 1,one,2,two,3,three
}
</SCRIPT>
<input type='hidden' id='id' />
<input type='text' id='custname' -onKeypress='autocomplete();' />
Edit: The function I am calling has a single array passed to it to perform the autocomple. So If I can figure out how to build a new array from the the Evens and another from the Odds in the filter variable, I should be okay.