Hi how can I change the below code to fill an input textbox instead of a select menu based on the value that is selected from the first menu
[code=html]
<form name=”classic”>
<select name=”countries” onchange=”updatecities(this.selectedIndex)” style=”width: 150px”>
<option value=”home”>Home Phone</option>
<option value=”cell”>Cell Phone</option>
<option value=”work”>Work Phone</option>
<option value=”all”>All Phone</option>
</select>
<select name=”cities” style=”width: 150px” onClick=”alert(this.options[this.options.selectedIndex].value)”>
</select>
</form>
<script type=”text/javascript”>
var countrieslist=document.classic.countries
var citieslist=document.classic.cities
var cities=new Array()
cities[0]=””
cities[1]=[“<?php echo $_SESSION[‘home_phone’]; ?>|<?php echo $_SESSION[‘home_phone’]; ?>”]
cities[2]=[“Vancouver|vancouvervalue”, “Tonronto|torontovalue”, “Montreal|montrealvalue”, “Calgary|calgaryvalue”]
cities[3]=[“London|londonvalue”, “Glasgow|glasgowsvalue”, “Manchester|manchestervalue”, “Edinburgh|edinburghvalue”, “Birmingham|birminghamvalue”]
function updatecities(selectedcitygroup){
citieslist.options.length=0
if (selectedcitygroup>0){
for (i=0; i<cities[selectedcitygroup].length; i++)
citieslist.options[citieslist.options.length]=new Option(cities[selectedcitygroup][i].split(“|”)[0], cities[selectedcitygroup][i].split(“|”)[1])
}
}
</script>