473,773 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1468
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="docum ent.getElementB yId('METHOD').v alue=this.optio ns[this.selectedIn dex].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
2168
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 become visible....If they keep the dropdown box at "No" (default) then I want to submit the form "as is", keeping the inapplicable HTML fields hidden....I'm trying an "if statement" in ASP....Here's my code....I'm thinking that the if statement...
5
2610
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 validation on both. Is there a way to link the drop-down choice to the correspondent validation section while disabling validation for the other one? here's what I presently have:
2
9473
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 the choice made in the first drop-down list? If so, how can that be done? I am working with 'Teach Yourself Microsoft Access' and I didn't see it discussed in that book (if it's even possible to do). Or would I just have to create linked tables...
2
2471
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 click on the Unplatted Radio button, the rest isn't functional, yet. Any ideas how to make these drop down in FF. This works in IE. Here is the code: <HTML> <HEAD> <TITLE>Door County Register of Deeds - Tract Inquiry</TITLE>
5
1822
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 3 or more e-mail addresses. I'm using a drop down menu to select the type of question the user wants to ask then using this to determine what e-mail address to pick. The cgi on the server is configured to only send an e-mail if the "mailto" field...
2
1665
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 show the email address that its to submit to and if you select option B then the rest of the form appear and the Email Recepient field will show a different email adress for option B and the form will then submit to the option B address. Im not sure...
106
19833
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 gladly delete my question an put it in the correct section. Well what i am trying to do is pretty simple. I have a input field and someone starts typing in a customer number. As they type in the customer number the drop down box is populated. They...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.