Forum Moderators: open
i have some data that i want to put in some sort of javascript array. the data is basically addresses which have address ID's which is basically like this:
ID: 70 => Adresss: 123 StreetName, ZIP1
ID: 71 => Adresss: 456 StreetName, ZIP2
I want to be able to somehow store that in a javascript array and then be able to use a textfield with javascript that searches through the arrays to display the matches and once the match is selected i need it to create a textfield with the value of the ID like this:
<input type=text name=address_id value=70>
any suggestions on how i can do this would be appreciated.
thanks
well basically what i've done so far is create an array with the array index as the ID value of the address, like this:
var array=new Array();
array[70]="Address 1, ZIP 1";
array[71]="Address 2, ZIP 2";
array[72]="Address 3, ZIP 3";
array[73]="Address 4, ZIP 4";
with the above i am able to display the ID value of an address by defining the address like this:
var index = array.indexOf("Address 4, ZIP 4");
document.write("<input type='text' name='address_id' value='"+index+"'>");
the next few things that i need help in doing is being able to search for a zip code for example and it would list matches and i select the match i want and that will basically the value of the input field.
any ideas?
thanks