JonathanG6SWJ
Programmer
Hi Guys.
I've played with the syntax below so much I've forgotten what I've tried and what I haven't. So I thank you in advance for keeping me sane. I am trying to retrieve the index value for the option box.
Here's the function
Here's an example of my option box
Here's my submit code
Basically I can't get the value="<%= getIndex()%>"> bit of code to work
Many thanks in advance
Jonathan
I've played with the syntax below so much I've forgotten what I've tried and what I haven't. So I thank you in advance for keeping me sane. I am trying to retrieve the index value for the option box.
Here's the function
Code:
<script type="text/javascript">
function getIndex()
{
var x=document.getElementById("mySelect")
}
</script>
Code:
<select name="J" id="mySelect" >
<option value="a">a</option>
<option value="b">b</option>
<option value="c" selected>c</option>
</select>
Here's my submit code
Code:
<input type="hidden" name="Result" value="<%= getIndex()% >">
Basically I can't get the value="<%= getIndex()%>"> bit of code to work
Many thanks in advance
Jonathan