SQL PHP HTML ASP JavaScript articles and free scripts to download
HTML Web Form

Checkbox in HTML form

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. Don't add any single or double quote to this.

Example:

<input type="Checkbox" name="blue" value="yes" Checked>Blue
<input type="Checkbox" name="red" value="yes">Red
<input type="Checkbox" name="green" value="yes">Green

This will give the output like :

Favourite Color(s): Blue Red Green

Radio buttons: Difference between checkbox and Radio buttons

Be the first to post comment on this article :


Google+
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer