SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Radio button queries
-
May 22, 2008, 23:47 #1
- Join Date
- Jun 2006
- Location
- Australia
- Posts
- 189
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Radio button queries
Gudday all
I would like to have a form with radio buttons and some text boxes and have some questions
Code:<form name="catalogueDetails" method="post" action=""> <input type="radio" checked="checked" name="printed" value="printed" />Printed version <span style="margin-right:45px;"></span> <input type="radio" name="cd" value="cd" />CD version<br /><br /> <label>Name*:</label><input name="name" type="text" size="30" /> <br /><br /> <label>Address*:</label><input name="address" type="text" size="30" /> <br /><br /> <label>City/Town*:</label><input name="city" type="text" size="30" /> <br /><br /> <label>State*:</label><input name="state" type="text" size="30" /> <br /><br /> <label>Post code*:</label><input name="postcode" type="text" size="30" /> <input type="submit" value="Order Catalogue"> </form>
2. By default the radio button is printed version yet it allows me to choose the cd version as well i.e. I can have both buttons selected simultaneously. I thought that this was not allowable?========================
Carn the Tiges!
www.petalsandpatches.com
-
May 23, 2008, 03:52 #2
- Join Date
- Jun 2003
- Location
- East Coast
- Posts
- 2,215
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
1. What exactly do you mean? You can have as many radio buttons as you want in each form...
2. You need to name the radio buttons the same name if you want to choose between them and not be able to select both. For example:
Code:<input type="radio" name="yesno" value="yes">Yes <input type="radio" name="yesno" value="no">No
Code:<input type="radio" checked="checked" name="medium" value="printed" />Printed version <span style="margin-right:45px;"></span> <input type="radio" name="medium" value="cd" />CD version<br /><br />
█ Nick . all that we see or seem, is but a dream within a dream
█ Show someone you care, send them a virtual flower.
█ Good deals on men's watches
-
May 23, 2008, 05:57 #3
- Join Date
- Jun 2006
- Location
- Australia
- Posts
- 189
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
========================
Carn the Tiges!
www.petalsandpatches.com
-
May 23, 2008, 06:39 #4
- Join Date
- Jun 2003
- Location
- East Coast
- Posts
- 2,215
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I was a little unclear. What I meant can I combine radio buttons and text entry areas within the same
<form>
...
</form>?█ Nick . all that we see or seem, is but a dream within a dream
█ Show someone you care, send them a virtual flower.
█ Good deals on men's watches
-
May 23, 2008, 07:19 #5
- Join Date
- Jan 2004
- Location
- The Kingdom of Denmark
- Posts
- 2,702
- Mentioned
- 7 Post(s)
- Tagged
- 0 Thread(s)
You can't have both a checkbox and a radiobutton for the same form control. That would defeat the purpose of radiobuttons. Also, radiobuttons and checkboxes are different things; a checkbox is either yes or no, a radiobutton is a choice between multiple options.
You can of course combine the two elements, but they will have to have different names.
Bookmarks