suhayda
03-12-2004, 08:59 PM
Hey there, this will be easy for most of you...
my site has a city selection with radio buttons. When I click on a radio button I need to input the city name into a designated text field and input the appropriate state abbreviation into a pulldown menu next to it.
Right now the City works perfect, how can I now change the state as well with it?
the code to define the cities (which I got here) :) :
<script>
var city = new Array();
city["Atlanta"] = ["Atlanta",""];
city["Boston"] = ["Boston",""];
city["Chicago"] = ["Chicago",""];
city["Dallas"] = ["Dallas",""];
city["Denver"] = ["Denver",""];
city["Hawaii"] = ["Hawaii",""];
city["Las Vegas"] = ["Las Vegas",""];
city["London"] = ["London",""];
city["Los Angeles"] = ["Los Angeles",""];
city["Miami"] = ["Miami",""];
city["New Orleans"] = ["New Orleans",""];
city["New York"] = ["New York",""];
city["Orlando"] = ["Orlando",""];
city["Paris"] = ["Paris",""];
city["Phoenix"] = ["Phoenix",""];
city["San Diego"] = ["San Diego",""];
city["San Francisco"] = ["San Francisco",""];
city["San Jose"] = ["San Jose",""];
city["Seattle"] = ["Seattle",""];
city["Washington"] = ["Washington",""];
function setCode(theRadio){
theForm = theRadio.form;
}
</script>
the following is a sample of one radio button:
<label for="Los Angeles"><INPUT type="radio" name="searchShortCityName" value="Los Angeles"
onclick="setCode(this)" id="Los Angeles">Los Angeles</label>
And my pulldown menu looks the following:
<select name=state id="select2" size=1 class=content-sm>
<option value="">
<option value= "AK">AK - Alaska</option>
<option value="AL">AL - Alabama</option> <option value="AR">AR - Arkansas</option>
etc...
my site has a city selection with radio buttons. When I click on a radio button I need to input the city name into a designated text field and input the appropriate state abbreviation into a pulldown menu next to it.
Right now the City works perfect, how can I now change the state as well with it?
the code to define the cities (which I got here) :) :
<script>
var city = new Array();
city["Atlanta"] = ["Atlanta",""];
city["Boston"] = ["Boston",""];
city["Chicago"] = ["Chicago",""];
city["Dallas"] = ["Dallas",""];
city["Denver"] = ["Denver",""];
city["Hawaii"] = ["Hawaii",""];
city["Las Vegas"] = ["Las Vegas",""];
city["London"] = ["London",""];
city["Los Angeles"] = ["Los Angeles",""];
city["Miami"] = ["Miami",""];
city["New Orleans"] = ["New Orleans",""];
city["New York"] = ["New York",""];
city["Orlando"] = ["Orlando",""];
city["Paris"] = ["Paris",""];
city["Phoenix"] = ["Phoenix",""];
city["San Diego"] = ["San Diego",""];
city["San Francisco"] = ["San Francisco",""];
city["San Jose"] = ["San Jose",""];
city["Seattle"] = ["Seattle",""];
city["Washington"] = ["Washington",""];
function setCode(theRadio){
theForm = theRadio.form;
}
</script>
the following is a sample of one radio button:
<label for="Los Angeles"><INPUT type="radio" name="searchShortCityName" value="Los Angeles"
onclick="setCode(this)" id="Los Angeles">Los Angeles</label>
And my pulldown menu looks the following:
<select name=state id="select2" size=1 class=content-sm>
<option value="">
<option value= "AK">AK - Alaska</option>
<option value="AL">AL - Alabama</option> <option value="AR">AR - Arkansas</option>
etc...