473,388 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Using drop down to chagnge value of hidden form field

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.

Mar 31 '07 #1
3 1451
Please disregard. I figured it out.
Mar 31 '07 #2
On Mar 31, 2:35 am, njbigNOS...@aol.com (Noah) wrote:
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.
<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>

Mar 31 '07 #3
Noah wrote:
Please disregard. I figured it out.
I wouldn't use "METHOD" as a form control name or id.
Mick
Mar 31 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dmiller23462 | last post by:
I'm trying to create a submission page for users to request PC/LAN Access....If they select "Yes" in the field asking about if they need Non Standard Software, I want several other HTML fields to...
5
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
2
by: tpaulson | last post by:
I have a couple of DIV's that I hide/display based on radio buttons. On the DIV's, I have multiple drop down boxes. The source shows that they are populated, but I can't make them drop down. Only...
5
toxicpaint
by: toxicpaint | last post by:
Hi there. I can't seem to work out what I'm doing wrong here and I was wondering if you could help. I have a form to submit a question, but as the questions vary in nature, I want them to go to...
2
by: AR123 | last post by:
Hi I have a created a form. I have a field called Type with options A or B. I want to have my form so that it you select option A the rest of the form will appear and the Email Recepient field will...
106
by: bonneylake | last post by:
Hey Everyone, Well i don't know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.