Page 139 - TP_iPlus_V2.1_Class7
P. 139
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.
• ENCTYPE: This attribute specifies the data encoding method a web browser uses before
sending it to the server. This attribute can take any of the following values:
§ application/x-www-form-urlencoded: It is used when you want to encode the URL.
§ multipart/form-data: It is used when you want to upload a file or image.
§ text/plain: It is used to send the data without any encoding.
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.
137
More on HTML

