Help with changing radio buttons to checkboxes


#1

Please have a look at the code below. I’m struggling so much with this… I have radio buttons in this current form. When a registrant makes selections, it allows for all the radio buttons to be selected, but they can’t be unselected, unless the entire form is reset.

So, I thought Checkboxes would be the best alternative. I am trying to change all the radio buttons to checkboxes, but after that, what else do I need to do?

  1. Will all the selected options (from the registration page) still dump into the database? or do changes have to be made there as well?

I guess that’s enough to start with…

[php]



























































































































Basic information





 
First
name:



Last name:


Phone:


E-mail:


Password




Gender:

Select -->
Male
Female



Additional information





Street Address

City


State
Az

Zip
*
Date of Birth



(Mon
/ day / year ; 10/17/1970)
 
Free
Agents

select what leagues you are interested
in playing on


Tuesday co-ed   Friday co-ed    
Saturday soccer league   Sunday soccer league    
Flag Football   Kickball  
 
Women’s soccer          
 


Feel free to give us comments




 

SPAM guard: (Need to answer
correctly)


What is the answer to the match question ten
plus two:




 


    </FORM>[/php]

#2

JPC, I think you are not clear on what a radio button is. They are used for a choice of one subject only.
Such as select-your-color. Red/blue/black/green. All of the radio’s for these four colors would have the exact same name. Let’s say “colors”. Then, if the user clicks on the RED radio-button, the others would automatically be cleared and that one would indicate selected. Each of the radio buttons would have a different hidden value of, value=“red”, value=“blue”, etc… So, when reading them inside the PHP code once the page is submitted, you just use $_POST[‘colors’] and this would say red, blue, etc… Whichever was selected. They are handy and useful and easy. If you have two different items to select from, such as colors and font-sizes, just use two different groups of Radio Buttons using the names of name=“colors”, name=“fontsize”. Then, your PHP code can use the data they pick. Otherwise, use checkboxes.

Normally, use radio’s for options where only certain values are allowed. (Or use a drop-down)
And, when several options are allowed, use checkboxes. (If they can select more than one color that is then used randomly as an example…)

Hope that helps…