Hi,
I have 3 drop down boxes, one contains the country, second is the pickup location and third is the dropoff location.
Basically when the page loads, I want it to select the country as USA the pick up as los angeles and drop off as los angeles. I have tried using the selectedIndex, but it doesn't seem to populate the country and pickup. So my code is as follows:
<select accessKey="o" name="area" style="margin-left:2px;"
onchange="document.details.slct.value=0;ckDstn(document.details.elements['area'].options[document.details.elements['area'].selectedIndex].value);">
<OPTION VALUE="132"> USA
</option></select>
select accessKey="o" name="tlocation" class="t3" onChange="this.form.slct.value = this.selectedIndex;ckPickUp(document.details.elements['tlocation'].options[document.details.elements['tlocation'].selectedIndex].value);">
<option value="" class="t3">select a location</option>
</select>
<select accessKey="o" name="tdropoff" class="t3" onChange="this.form.slct2.value = this.selectedIndex">
<option value="" class="t3">select a location</option>
</select>
<script>
document.details.area.options[document.details.area.selectedIndex].value=132;
document.details.tlocation.options[document.details.tlocation.selectedIndex].value="los angeles airport";
document.details.tdropoff.options[document.details.tdropoff.selectedIndex].value="los angeles airport";
</script>
Can anyone help and let me know what I am doing wrong
Thanks
I have 3 drop down boxes, one contains the country, second is the pickup location and third is the dropoff location.
Basically when the page loads, I want it to select the country as USA the pick up as los angeles and drop off as los angeles. I have tried using the selectedIndex, but it doesn't seem to populate the country and pickup. So my code is as follows:
<select accessKey="o" name="area" style="margin-left:2px;"
onchange="document.details.slct.value=0;ckDstn(document.details.elements['area'].options[document.details.elements['area'].selectedIndex].value);">
<OPTION VALUE="132"> USA
</option></select>
select accessKey="o" name="tlocation" class="t3" onChange="this.form.slct.value = this.selectedIndex;ckPickUp(document.details.elements['tlocation'].options[document.details.elements['tlocation'].selectedIndex].value);">
<option value="" class="t3">select a location</option>
</select>
<select accessKey="o" name="tdropoff" class="t3" onChange="this.form.slct2.value = this.selectedIndex">
<option value="" class="t3">select a location</option>
</select>
<script>
document.details.area.options[document.details.area.selectedIndex].value=132;
document.details.tlocation.options[document.details.tlocation.selectedIndex].value="los angeles airport";
document.details.tdropoff.options[document.details.tdropoff.selectedIndex].value="los angeles airport";
</script>
Can anyone help and let me know what I am doing wrong
Thanks