Category: HTML

An INPUT tag with attribute type ="checkbox" offers the user an "on" or "off" switch. Each check box works independently from the others, visitors can select or deselect any combination of checkboxes use of these boxes is appropriate for open questions or questions that have more than one "right" answer. Checkboxes appear as square boxes and contain a checkmark when act as a checkbox is switch on when the form is submitted its value attribute is submitted as the form data for the named form component.

 

Syntax

 

<INPUT type = "Checkbox" name ="box -id" Value = "choice-id" checked>

 

Name: To specify separate name for each checkbox. Unlike radio buttons, each item has a separate label. Although the checkboxes visually appear as a set, logically the items are completely separate.

Value: To provide a descriptive value for each checkbox.

Checked: To specify default selection.

 

<HTML>

<HEAD><TITLE> TEXT FIELDS</TITLE></HEAD>

<BODY BGCOLOR="PINK">

<P ALIGN ="CENTER"><B>ADMISSION FORM</B>

<FORM>

<P>

<INPUT TYPE ="TEXT" NAME="NAME" VALUE="ENTER YOUR NAME:" SIZE="25" MAXLENGTH="30"> NAME<BR><BR>

<INPUT TYPE ="PASSWORD" NAME="PASSWD" SIZE="25" MAXLENGTH="30"><BR><BR>

<INPUT TYPE ="TEXT" NAME="ADDRESS" SIZE="25" MAXLENGTH="30">

ADDRESS<BR><BR>

<INPUT TYPE=”RADIO” NAME=”SEX” VALUE=”MALE” CHECKED>MALE<BR>

<INPUT TYPE=”RADIO” NAME=”SEX” VALUE=”FEMALE” >FEMALE<BR>

<INPUT TYPE=”CHECKBOX” NAME=”VEHICAL” VALUE=” VEHICAL” CHECKED>OWN VEHICAL<BR>

<INPUT TYPE=”CHECKBOX” NAME=”HOSTEL” VALUE=” HOSTEL” >HOSTEL REQUIRED<BR>

</FORM>

</BODY>

</HTML>



Dinesh ThakurDinesh Thakur is a Columinist and designer with strong passion and founder of Computer Notes. if you have any ideas or any request please get @me on Google+
linkedin FaceBook Twitter Google Plus