Basically here is the problem..
I have a Pulldown (selectedIndex) that looks like this.
<select name=test>
<option value="AL">Alabama
<option value="AK">Alaska
<option value="AS">Am. Samoa
What I a trying to do is pass values from a javascript to the form pulldown (selectedIndex).
# THE CODE #
<script language="javascript">
<!--//
function SelectOptions() {
document.theForm.country.selectedIndex = 2; // looksfor the 2nd value
document.theForm.country.selectedIndex = "US"; // doesn't work
}
//-->
</script>
Can someone help me on this? Thanx in advance..
I have a Pulldown (selectedIndex) that looks like this.
<select name=test>
<option value="AL">Alabama
<option value="AK">Alaska
<option value="AS">Am. Samoa
What I a trying to do is pass values from a javascript to the form pulldown (selectedIndex).
# THE CODE #
<script language="javascript">
<!--//
function SelectOptions() {
document.theForm.country.selectedIndex = 2; // looksfor the 2nd value
document.theForm.country.selectedIndex = "US"; // doesn't work
}
//-->
</script>
Can someone help me on this? Thanx in advance..