Page 142 - TP_iPlus_V2.1_Class7
P. 142
To add the check box in the form, follow the syntax as given below:
<INPUT TYPE="CHECKBOX" NAME="Name of check box" VALUE="value of check box">
For example:
<INPUT TYPE="CHECKBOX" NAME="Hobbies" VALUE="Reading" CHECKED>
TYPE="CHECKBOX" indicates that the form element is check box.
NAME="Hobbies" is the name of the check box.
VALUE="Reading" is the default value of check box.
CHECKED attribute selects the specific check box by default.
Let us create a web page to display the check box.
<!DOCTYPE html>
<HTML>
<BODY>
<FORM>
Hobbies: <BR>
<INPUT TYPE="CHECKBOX" NAME="Hobbies" VALUE="Reading"> Reading <BR>
<INPUT TYPE="CHECKBOX" NAME="Hobbies" VALUE="Reading"> Travelling <BR>
<INPUT TYPE="CHECKBOX" NAME="Hobbies" VALUE="Reading"> playing games <BR>
<INPUT TYPE="CHECKBOX" NAME="Hobbies" VALUE="Reading"> singing & dancing <BR>
</FORM>
</BODY>
</HTML>
Adding Password Field
This is also a single-line text input, but it masks the character as soon as a user enters a character/
number into it. The password is not visible to the user in password field control.
To add the password field to the form, follow the syntax as given below:
<INPUT TYPE="PASSWORD" NAME="Name of Password Field" SIZE="Size of the password
Field">
For example:
<INPUT TYPE="PASSWORD" NAME="Pass" SIZE="10">
TYPE="PASSWORD" indicates that the form element is password.
Name="Pass" indicates that the name of the password field is "Pass".
SIZE="10" denotes the maximum size of the password field i.e. '10'.
140
iPlus (Ver. 2.1)-VII

