Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic dropdown - select list value depending on input

Status
Not open for further replies.

ifx

Technical User
Feb 26, 2002
57
GB
Hi,

I'm creating a form for users to input their telephone numbers. Before going to this page they select their country: gb, ie, us, de or ww (world wide). They then proceed to this page where they input their telephone number and select their country code from a long list. Would it be possible (either javascript or ASP) to search through the list (see below) using the two letter country code so that the matching country code is the selected one in the drop down? If ww then the none is selected? It would make the form much easier to use as it's quite a big list.

Thanks a lot for your help!

Here's a party of the (long!!) drop down:

<select name=&quot;code&quot;>
<option value='247'>AC (+247)</option>
<option value='376'>AD (+376)</option>
<option value='971'>AE (+971)</option>
<option value='93'>AF (+93)</option>
<option value='1'>AG (+1)</option>
<option value='1'>AI (+1)</option>
<option value='355'>AL (+355)</option>
<option value='374'>AM (+374)</option>
<option value='599'>AN (+599)</option>
<option value='244'>AO (+244)</option>
<option value='672'>AQ (+672)</option>
<option value='54'>AR (+54)</option>
<option value='684'>AS (+684)</option>
...
</select>
 
I'd do it in the ASP code personally. It's certainly possible in javascript though, so shout if you really wanna do it that way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top