Hi
I have about 20 checkboxes on a register page for my site. I want to make sure that at least 3 of them have been checked. How would i go about doing this?
| SitePoint Sponsor |
Hi
I have about 20 checkboxes on a register page for my site. I want to make sure that at least 3 of them have been checked. How would i go about doing this?

If you have named them as checkbox_name[], then you can simply use
PHP Code:if(count($_POST["checkbox_name"])<3)
echo "please select atleast 3 checkbox";
How would I name them?
All i've got is:
Code:Choose up to 3 genres which best suit you:*<br><br> <input type="checkbox" name="rockcheck">Rock <input type="checkbox" name="metalcheck">Metal // etc...
Nevermind i've done it! Thanks for the reply!![]()
Bookmarks