473,386 Members | 2,042 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,386 software developers and data experts.

Select a radio button have another value passed on also in form- How?

I'm offering a selection of three items. One is $25, the second is $50, the third is $100.
Along with selection one of the items I need to pass the quantity of the selection. Here is
the code now.
<tr><td><input type="radio" name="item_name" value="Reduced">Reduced</td><td><input
type="radio" name="amount" value="25">$25.00ea.</td></tr>

<tr><td><input type="radio" name="item_name" value="Regular">Regular</td><td><input
type="radio" name="amount" value="50">$50.00ea.</td></tr>

<tr><td><input type="radio" name="item_name" value="Premium">Premium</td><td><input
type="radio" name="amount" value="100">$100.00ea.</td></tr>

<tr><td>Number of Tickets: </td><td><INPUT TYPE="text" NAME="quantity" size="3"></td></tr>

Having a radio button for "amount" and "item_name" isn't going to work.

I can't figure out how to get the "amount" to be passed when the radio button for
"item_name" is selected.

Can I do this in a simple HTML form? And how?

Thanks in advance

Jul 23 '05 #1
2 2873
On Tue, 26 Oct 2004 11:25:29 -0400, Stoic <st************@aequalis.com>
wrote:
I'm offering a selection of three items. One is $25, the second is $50,
the third is $100.
Along with selection one of the items I need to pass the quantity of the
selection. Here is
the code now.

<tr><td><input type="radio" name="item_name"
value="Reduced">Reduced</td><td><input
type="radio" name="amount" value="25">$25.00ea.</td></tr>

<tr><td><input type="radio" name="item_name"
value="Regular">Regular</td><td><input
type="radio" name="amount" value="50">$50.00ea.</td></tr>

<tr><td><input type="radio" name="item_name"
value="Premium">Premium</td><td><input
type="radio" name="amount" value="100">$100.00ea.</td></tr>

Having a radio button for "amount" and "item_name" isn't going to work.


Why not? Why do you need both values? From what we can see above Reduced =
25, Regular = 50 and Premium = 100, so just pass one value and let the
server side code handle the rest.

Steve

Jul 23 '05 #2

"Stoic" <st************@aequalis.com> wrote in message
news:MP************************@news.giganews.com. ..
I'm offering a selection of three items. One is $25, the second is $50, the third is $100. Along with selection one of the items I need to pass the quantity of the selection. Here is the code now.
<tr><td><input type="radio" name="item_name" value="Reduced">Reduced</td><td><input type="radio" name="amount" value="25">$25.00ea.</td></tr>

<tr><td><input type="radio" name="item_name" value="Regular">Regular</td><td><input type="radio" name="amount" value="50">$50.00ea.</td></tr>

<tr><td><input type="radio" name="item_name" value="Premium">Premium</td><td><input type="radio" name="amount" value="100">$100.00ea.</td></tr>

<tr><td>Number of Tickets: </td><td><INPUT TYPE="text" NAME="quantity" size="3"></td></tr>
Having a radio button for "amount" and "item_name" isn't going to work.

I can't figure out how to get the "amount" to be passed when the radio button for "item_name" is selected.

Can I do this in a simple HTML form? And how?


Why do you have two radio buttons for each choice in the first place? You
should have a single radio button for each choice. Each one's value should
be something from which the code at the server will be able to determine
both the type of admission and the price.

Jul 23 '05 #3

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

Similar topics

1
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: Dave | last post by:
Hi, there used to be a simple javascript quiz builder in builder.com, with which I made the page whose code is given below. I would like to tweak this so that there are only three (not 4) answer...
15
by: JR | last post by:
Hi. I hope someone out there who is more versed with JavaScript than I can help me with the following annoying problem. Here's the problem. I have a form with the following layout: Column A...
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
8
by: David Cameron | last post by:
I noticed that using an HTMLInputRadioButton and specifying a value to be an empty string (""), this is overridden by ASP.Net which set the value of the control to be the same as the ID of the...
5
by: Fran Jakers | last post by:
Hello all, I'm new to all this and I could really use some help. I've searched the web but cannot find an answer. I have an HTML form with 3 radio buttons and a search field that calls a...
1
by: runway27 | last post by:
hi i have registration form where user selects from a drop down to select their area code apart from filling other details in the form. in the next page which is a confirmation page i would like...
11
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.