Radio buttons are mutually exclusive - even if you have 5 of them, you get no more than one in the $_POST input. You can get zero, if the client selected nothing.
Checkboxes are not mutually exclusive - You can get zero or more (up to the total number of checkboxes) depending on what the client selected. A checkbox that is not checked does NOT come through in the $_POST input. Why is this important?
If you put up a form with a checkbox that is checked (ie: a member in good standing) and the client un-checks it, the checkbox will be absent in $_POST - you can't check for a value of "off" or something helpful like that. Instead you have to know that the checkbox exists and know that its absence in $_POST means a change of state. A nuisance, but forewarned is forearmed!
I think when you are testing with these things it is helpful to put this into the script: var_dump($_POST);
best of luck with your project, ~Ray
Main Topics
Browse All Topics





by: quincydudePosted on 2008-11-18 at 23:47:18ID: 22992274
The idea is like putting a checkbox (all with the same name) next to each username
<input type="checkbox" name="userlist[]" value="$userid"> , where $userid is the user of each username.
After submit the form , you can get the selected list by
Select allOpen in new window