B
Bob Bedford
I've a page where users may enter a zip code (text edit) and I want to fill
a combobox with existing cities depending on the zip code entered.
Let give an example.
I've my text edit like:
<input name="ZIP" type="text" id="ZIP" onKeyUp="fillcitycombo();">
<select name="City" id="City"></select>
When entering the zip code, I'd like the fillcitycombo() function to fill
the combobox with the matching cities.
For example I've
IDCity ZIP City
1 1950 Sion
2 1950 Pont-de-la-Morge
3 3960 Sierre
4 3960 Corin
So user's entry 3960 should fill the combo with Sierre, ID 3 and Corin, ID
4, as selecting 3 or 4 will change the city (that share the same ZIP code).
Of course the ZIP and city datas will be in the javascript source, as client
side there is no access to the DB. For info, in the client's DB I store the
IDCity code.
Thanks for help.
Bob
a combobox with existing cities depending on the zip code entered.
Let give an example.
I've my text edit like:
<input name="ZIP" type="text" id="ZIP" onKeyUp="fillcitycombo();">
<select name="City" id="City"></select>
When entering the zip code, I'd like the fillcitycombo() function to fill
the combobox with the matching cities.
For example I've
IDCity ZIP City
1 1950 Sion
2 1950 Pont-de-la-Morge
3 3960 Sierre
4 3960 Corin
So user's entry 3960 should fill the combo with Sierre, ID 3 and Corin, ID
4, as selecting 3 or 4 will change the city (that share the same ZIP code).
Of course the ZIP and city datas will be in the javascript source, as client
side there is no access to the DB. For info, in the client's DB I store the
IDCity code.
Thanks for help.
Bob