Checkbox tutorials

Checkbox is one of the important components of form field where user has to check by clicking the option. Checkbox values are directly taken to database or further used to process the script. Checkbox component inside a form has distinct role to play and in some cases only it is used. We can't use checkbox to ask for user to enter his / her email address. Let us try where we will use checkbox and where not to use.

Where to use Checkbox

If we present a set of options to our visitors and ask them give select some or all options then we have to use checkbox. The user can select one or more options. This is the basic difference between checkbox and radio buttons. In radio buttons only one options can be selected from a group and in a checkbox one or more than one option can be selected. Let us try for an example.

Let us present a list of weekdays to our visitor for their choice of days they want to visit a particular training program. Here the visitor can select all days or one day or any combination of days. But if we have the restriction that the visitor can select only one day out of the seven days of the week then we will show a group of radio ( or period ) buttons where only one selection can be made.

Some time we use one checkbox only and expect the visitor to check that button before submitting the form like asking the visitors to agree to site terms and conditions.

Code for a checkbox ( checked or unchecked )

<input type=checkbox name=days value='Sunday'> Sunday
<input type=checkbox name=days value='Monday'> Monday

To make Monday as checked
<input type=checkbox name=days value='Monday' checked> Monday

Checkbox tutorials

PHP Checkbox

Retaining valueRetaining same status once form is submitted back to same page
Linking to DataUpdating checkbox value from a database table
Array in formCheckbox value in array in a form and to read through PHP loop

Checkbox management using JavaScript

ValidationHow to do a checkbox validation in client side JavaScript
Checkbox ArrayCheckbox array in client side JavaScript
Check a groupUsing a single checkbox or button we can control a group of Checkbox
Limiting ChecksLimiting number of checkbox to be selected in a group
HTML basicCheckbox as a HTML form component - basics
ASP ArrayCheckbox array handling in ASP
JQuery ChekboxManaging Checkbox using JQuery
JQuery Chekbox & dataData grid with maximum number of selections

PHP Form Managing Radio button using PHP

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net



    This site really helped me to understand the PHP concept.

    Post your comments , suggestion , error , requirements etc here

    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer