Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
| Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2004, 09:40 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default allow only one checkbox to be checked!

I have three check boxes but I only want one to be able to be checked at a time. I should know how to do this but I can't remember.

Thanks

__________________
-----------------------------------------------------------
\"Don\'t follow someone who\'s not going anywhere\" John Mason
 
Old April 13th, 2004, 12:50 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I recommend using radio buttons (is this what you meant..?).

<input type=radio name=r1>
<input type=radio name=r2>
<input type=radio name=r3>

I believe the above should function correctly.

Let me know if it doesn't.

Snib

P2P Member
<><
 
Old April 13th, 2004, 08:34 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

The radio inputs have the share the same name to get the corelation between them.

<input type='radio' name='some_radio' value='value 1'>Value 1</input>
<input type='radio' name='some_radio' value='value 2'>Value 2</input>
<input type='radio' name='some_radio' value='value 3'>Value 3</input>

: )
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old April 15th, 2004, 09:18 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay thanks guys that works great, but here is my problem, how do I send the results of the radio buttons over the email?
My text boxes work fine and I was using a drop down dox and that worked fine but now with the radio buttons, inside the email it comes up blank(the vaule)

<td valign="middle" colspan=2>

<input type=radio name="sublength" VALUE="1">6 Issues - $25.87<br>
<input type=radio name="sublength" VALUE="2">12 Issues - $51.75<br>
<input type=radio name="sublength" VALUE="3">18 Issues - $77.62<br>
    </td>

I am not sure how to send the one that is picked to the email
Can you help me with this one?

Thanks

 
Old April 15th, 2004, 09:29 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I'm assuming you're e-mailing the results using the server. What server language are you using?

Snib

<><
 
Old April 15th, 2004, 10:59 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using asp

Session("Sublength") = Request.Form("SubLength")

newstr="Subscrption Length: " & Session("SubLength") & chr(13) & chr(10)

This is all I used when it was a drop down box,I can give you the whole code if you want but these are the parts that pertain to the radio buttons, now I want it to say which button was check instead of which one was picked from the drop down list.

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox checked all mateenmohd Javascript 1 January 2nd, 2007 06:19 AM
checkbox checked by default by html:checkbox sachin.tathod Struts 3 December 4th, 2006 03:41 PM
get the checked value from a checkbox array teklline123 Javascript How-To 1 September 16th, 2006 11:02 AM
Checkbox checked? ninel ASP.NET 2.0 Professional 1 April 12th, 2006 10:50 PM
Has checkbox been checked or unchecked? mat41 Javascript 4 December 8th, 2004 12:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.