Hi I have some code here that fills a dropdown box from an array depending on what is selected in another dropdown box. One of them is disabled, and i would like to stop that once an option has been selected.
This is the Javascript:
function fillStates(opt){
s=document.f.states.options
s.length=stateNames[opt].length
for(i=0;i<s.length;i++){
s[i].value=stateNames[opt][i]
s[i].text=stateNames[opt][i]
}
document.f.states.selectedIndex=0
}
and the html
<form name="f">
<select name=countries onChange="fillStates(this.options[this.selectedIndex].value)">
<? echo $optionc; ?>
</select>
<select name=states disabled="disabled">
<option>Choose a country first</option>
</select>
</form>
if anyone could give me a way to remove the disabled part on the second box once an option in the first box has been selected I would be grateful.
Thanks