Hello.
I have a form like so:
<FORM NAME="form1" METHOD = "post">
<SELECT NAME="select">
<OPTION VALUE = "1">Option 1</OPTION>
<OPTION VALUE = "2">Option 2</OPTION>
<OPTION VALUE = "3">Option 3</OPTION>
</SELECT>
<INPUT TYPE="HIDDEN" NAME="METHOD" VALUE=""
</FORM>
Depending on which option value the user selects, I need to change the
VALUE="" part of the hidden field "METHOD" to the value of the selected
option (1, 2 or 3).
How do I do that? Thanks.
Noah - 31 Mar 2007 02:47 GMT
Please disregard. I figured it out.
Michael White - 31 Mar 2007 08:32 GMT
> Please disregard. I figured it out.
I wouldn't use "METHOD" as a form control name or id.
Mick
shimmyshack - 31 Mar 2007 02:55 GMT
> Hello.
>
[quoted text clipped - 17 lines]
>
> How do I do that? Thanks.
<FORM NAME="form1" METHOD="post">
<SELECT NAME="select"
onchange="document.getElementById('METHOD').value=this.options[this.selectedIndex].value">
<OPTION VALUE = "1">Option 1</OPTION>
<OPTION VALUE = "2">Option 2</OPTION>
<OPTION VALUE = "3">Option 3</OPTION>
</SELECT>
<INPUT TYPE="HIDDEN" ID="METHOD" NAME="METHOD" VALUE="" >
</FORM>