Page 82 - TP-Play_V-2.0_Book-8
P. 82

The <INPUT> Tag

            The <INPUT> tag is one of the most important form elements. It is used to create the controls
            or fields to take the input from the user in the form of text, selection and click. The <INPUT> tag
            has the following attributes:

                ✶ TYPE: This attribute is used to specify the type of field we want to create. It takes one of the
               predefined values. The predefined values for this attribute are:

                  TEXT: This value is used to create a text box field. A text box field is a one line text input
                  control. The text is the default value of the TYPE attribute.
                  RADIO: This value is used to create a radio button control. A radio button control is used
                  to select only one option from a set of options.

                  CHECKBOX: This value is used to create a check box control. A check box control allows
                  us to select multiple options from a set of options.

                  BUTTON: This value is used to create a action button control. An action button control is
                  used to perform an action on the click of it.
                  SUBMIT: This value is used to create a submit button control. The submit button control
                  is used to submit all the entered values in form to the specified URL.

                  RESET: This value is used to create a reset button control. The reset button control, when
                  clicked, clears all the values entered in the form fields.

                  PASSWORD: This value is used to create a password field. A password field is just similar
                  to a text box field. The only difference is that the text entered in the password field will not
                  readable because it appears in the form of stars symbol.
                ✶ NAME: This attribute is used to specify the identity of the field on the web page.

                ✶ VALUE: This attribute is used to specify the default value of the field.
            The syntax of the <INPUT> tag is as follows:

                       <INPUT ATTRIBUTE="VALUE" NAME="VALUE">
            Let us create a web page containing login form to accept the user name and password from the
            user. Code to create the Form.html is as follows:

            <HTML>

            <HEAD>
            <TITLE> Login Form </TITLE>

            </HEAD>
            <BODY BGCOLOR="lightyellow">

            <FORM>
            User Name : <INPUT TYPE="TEXT" NAME="USER NAME"> <BR>







             82       Play (Ver. 2.0)-VIII
   77   78   79   80   81   82   83   84   85   86   87