SQL PHP HTML JavaScript articles and free code
 

Checkbox

Checkboxes are objects of a HTML form which behaves like a toggle switch. i.e, a checkbox can be in one of the two states, either checked or unchecked. Checkboxes are used to return a single specific value to a webserver i.e, either true or false or 1 or 0.

Checkbox can be created as :

<input type="checkbox" name="name of the object " value="yes or no " checked>

Attributes of Checkbox Field:
Name: Specifies the name of the object through which it can be referenced.
Value: Specifies the value of the checkbox. This value will be returned if the checkbox is checked.
Checked:  If given, the checkbox will be checked by default else, it will not be checked.

Example:
Favourite colors: <input type="checkbox" name="blue" value="yes" Checked>  <input type="Red" name="red" value="yes">

This will give the output like :

Favourite Color(s): Blue Red

Discuss this tutorial at forum

List of HTML Tutorials

Form Fields  | Text Field  | Hidden Field  | Password Field  | TextArea  | RadioButton  | Checkbox  | Button  | Image Button  | Submit Button  | Reset Button  | Drop-Down Menu

 

Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.

Scripts
PHP
JavaScript
List of HTML Tutorial
<Form>
HTML Tags
Color Chart
HTML Calendar
Tags on web page
Web Design
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.