Validation (checking ) of checkbox selection on submit of FormCheck box is used to get user inputs within the form. A group of checkbox is used or a single check box is used to collect the options of the visitor. Here we will try with one checkbox and in another tutorial we will consider more than one checkbox.
In signup forms you will see one checkbox asking you to read the terms and conditions of the site and the user must agree to this by selecting a checkbox. On submit of the form the status of this checkbox is checked and if not checked by the user then alert message is displayed saying the user has to agree to the terms and conditions.
Here is one example of this system. For easy understanding one period button validation is included in the checking also. The user has to select one of the sexes and must agree to terms and condition by checking the checkbox.
To display the period button and check box see the code below.
More on CheckBox & PHP
Checkbox: Using checkbox with PHP Scripts
Validation: Checking the user input of a checkbox and showing message
Checkbox Array: Handling a group of checkbox by array
Disable checkbox: Disable and enable checkbox by clicking button
Disable Text box : Disable a textbox by a checkbox
Limit Checkbox : Limiting the number of checkbox can be checked by user
Check All : Checking or unchecking a group of checkbox by button or at single point