Click here to get back home

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

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Select a radio button have another value passed on also in form- How? Stoic 10-26-2004
Get Chitika Premium
Posted by Stoic on October 26, 2004, 12:25 pm
Please log in for more thread options
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



Posted by Harlan Messinger on October 26, 2004, 12:33 pm
Please log in for more thread options

> 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.



Posted by Steve Pugh on October 26, 2004, 5:30 pm
Please log in for more thread options
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



Similar ThreadsPosted
form data passed from an asp file to an aol e-mail account June 22, 2006, 9:28 am
set radio button color October 5, 2005, 7:22 am
radio button question March 26, 2008, 10:15 am
making an image part of the Radio button November 22, 2007, 11:43 am
Problems and questions regarding HTML form SELECT elements September 18, 2007, 6:38 pm
Submit a form without using a button? December 24, 2004, 4:26 pm
Help: Tooltips Over Form Button? January 21, 2005, 12:45 pm
Having no default button in a form August 24, 2005, 3:41 am
How to get rid of focus on submit button of a form. September 5, 2004, 1:21 pm
Using multiple button type="submit" elements within a form April 15, 2005, 4:24 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap