Hi, I'm using the following code to redirect to a new page with a select dropdown, which works fine:
[HTML]<script type="text/javascript">
<!--
function go(){
location=
document.FRM_NA ME.VALUE_NAME.
options[document.FRM_NA ME.VALUE_NAME.s electedIndex].value
}
//-->
</script>
<form action="" method="post" name="FRM_NAME" >
<select name="VALUE_NAM E" id="VALUE_NAME " onChange="go(); ">
<option value="001.html ">001</option>
<option value="002.html ">002</option>
<option value="003.html ">003</option>
</select>
</form>
[/HTML]
The problem is when I have multiple select dropdowns, I'd like to use the same function with vars for FRM_NAME & VALUE_NAME!
eg:
onChange="go(FR M001, VAL001);" and onChange="go(FR M002, VAL002);"
As a complete newbie to JS, I'd appreciate any help and apologise if this is very basic.
Thanks in advance.
KR idj
[HTML]<script type="text/javascript">
<!--
function go(){
location=
document.FRM_NA ME.VALUE_NAME.
options[document.FRM_NA ME.VALUE_NAME.s electedIndex].value
}
//-->
</script>
<form action="" method="post" name="FRM_NAME" >
<select name="VALUE_NAM E" id="VALUE_NAME " onChange="go(); ">
<option value="001.html ">001</option>
<option value="002.html ">002</option>
<option value="003.html ">003</option>
</select>
</form>
[/HTML]
The problem is when I have multiple select dropdowns, I'd like to use the same function with vars for FRM_NAME & VALUE_NAME!
eg:
onChange="go(FR M001, VAL001);" and onChange="go(FR M002, VAL002);"
As a complete newbie to JS, I'd appreciate any help and apologise if this is very basic.
Thanks in advance.
KR idj
Comment