Page 88 - TP_Play_V2.1_class8
P. 88

What is a Form?

                  An HTML5 form is an interface of a web page that enables the user to enter data (such as names,
                  e-mail addresses, passwords, phone numbers, etc.) to be sent to the server for processing. While
                  writing codes, there are various form elements that help in designing a form, like textboxes, radio
                  buttons, drop-down menus, checkboxes, passwords, lists, comboboxes, etc. Every form must
                  begin with a <FORM> tag, which is placed inside the body of the HTML5 document.
                  The <FORM> Tag

                  The <FORM> tag is used to create the form boundary on a web page. It is a container tag. All
                  other form related tags are placed inside the opening <FORM> and closing </FORM> tags.
                  The syntax to use the <FORM> tag is as follows:

                  <FORM>
                  ...
                  ...

                  (Form Elements)
                  ...
                  ...
                  </FORM>
                  Some commonly used attributes of the <FORM> tag are:

                      ACTION: This attribute specifies the action that will take place when the form is submitted. It
                     takes the URL of another web page or an e-mail address to receive the information.
                      METHOD: This attribute specifies the type of method the form will use to submit the entered
                     values. The most commonly used values for this attribute are POST and GET.
                  The <INPUT> Tag

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

                      NAME: This attribute is used to specify the identity of the field on the web page.

                      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 checkbox control. A checkbox control allows us
                       to select multiple options from a set of options.

                    •   BUTTON: This value is used to create an action button control. An action button control is
                       used to perform an action with a click.



                   86       Play (Ver. 2.1)-VIII
   83   84   85   86   87   88   89   90   91   92   93