HighDots Forums  

help with form - radio buttons

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss help with form - radio buttons in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DPSwebmaster
 
Posts: n/a

Default help with form - radio buttons - 11-23-2004 , 05:11 PM






I am working on a form with radio buttons and when I tested it, I noticed that
you can't uncheck the radio button, once it checked and choose another one.
Also, multiple choices are allowed and I only want one to be chosen.

here is my code:

<table cellspacing="0">
<tr>
<td>elementary schools</td>
<td><input name="elementary_schools" type="radio" value="" /></td>
</tr>
<tr>
<td>middle schools</td>
<td><input name="middle_schools" type="radio" value="" /></td>
</tr>
<tr>
<td>high schools</td>
<td><input name="high_schools" type="radio" value="" /></td>
</tr>
<tr>
<td>central services</td>
<td><input name="central_services" type="radio" value="" /></td>
</tr>
</table>

TIA


Reply With Quote
  #2  
Old   
Webmaster961
 
Posts: n/a

Default Re: help with form - radio buttons - 11-23-2004 , 05:20 PM






Multiple choices allowed with radio buttons? Wow... Never seen that one coming...

I would just place another radio button on the form with None as an option.

Reply With Quote
  #3  
Old   
Webmaster961
 
Posts: n/a

Default Re: help with form - radio buttons - 11-23-2004 , 05:40 PM



Ok, here's what's happening. When you named the radio elementary_schools it
messed it up somehow. I can name it anything and it still messes it up. I
don't know why, but it does. All I can suggest is that you put a reset button
down at the bottom, and say if more than one radio button is selected, please
push reset and press one. Or, put a note near the radiobuttons that says click
only one.

Sorry, but it did the same to me. I think it's a Dreamweaver error...


Reply With Quote
  #4  
Old   
Joe Makowiec
 
Posts: n/a

Default Re: help with form - radio buttons - 11-23-2004 , 05:42 PM



On Tue 23 Nov 2004 05:11:24p, DPSwebmaster wrote in
macromedia.dreamweaver:

Quote:
I am working on a form with radio buttons and when I tested it, I
noticed that you can't uncheck the radio button, once it checked and
choose another one. Also, multiple choices are allowed and I only want
one to be chosen.
For radio buttons to act as a group, they all have to have the same
name, thus:

<table>
<tr>
<td><label><input type="radio" name="RadioGroup" value="Elementary"> Elementary</label>
</td>
</tr>
<tr>
<td><label><input type="radio" name="RadioGroup" value="Middle"> Middle</label>
</td>
</tr>
<tr>
<td><label><input type="radio" name="RadioGroup" value="High"> High</label>
</td>
</tr>
</table>


Reply With Quote
  #5  
Old   
TC2112
 
Posts: n/a

Default Re: help with form - radio buttons - 11-23-2004 , 05:59 PM



Hello, The radio buttons have to all have the same name attribute to keep
more than one from being selected. Like this: Take care, Tim

<table cellspacing="0">
<tr>
<td>elementary schools</td>
<td><input name="samename" type="radio" value="elementary_schools"></td>
</tr>
<tr>
<td>middle schools</td>
<td><input name="samename" type="radio" value="middle_schools"></td>
</tr>
<tr>
<td>high schools</td>
<td><input name="samename" type="radio" value="high_schools"></td>
</tr>
<tr>
<td>central services</td>
<td><input name="samename" type="radio" value="central_services"></td>
</tr>
</table>


Reply With Quote
  #6  
Old   
TC2112
 
Posts: n/a

Default Re: help with form - radio buttons - 11-23-2004 , 06:08 PM



Note: You could now add another group of radio buttons to your page if you
needed to, with a different inpput name in those. You would be able to select
one button from each group, but not more than one button in each group. Take
care, Tim


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.