Page 120 - Plus_V2.2_C8_Flipbook
P. 120
We can use <FORM> element to create an HTML form. This is a container tag. This tag offers various
elements to collect information from the user like textboxes, checkboxes, radio buttons, submit
buttons etc.
<FORM> Tag
The <FORM> tag is an essential HTML element used for creating an interactive user interface for
gathering and submitting data on a web page. This is a container tag. This tag offers various elements
to collect information from the user like textboxes, checkboxes, radio buttons, submit buttons, etc. It
is utilised to specify the behaviour and structure of a form.
Syntax of <FORM> tag.
<FORM>
…
Form elements
…
</FORM>
Attributes of <FORM> Tag
The <FORM> tag has the following attributes:
ACTION: This attribute specifies what action should be taken once the SUBMIT button is clicked by
the user. The Script URL specifies the location where the data collected by the form is submitted. It
also produces a response in return.
METHOD: This attribute specifies what will happen when the form is submitted. Two values can be
assigned to the METHOD attribute, Get and Post.
Get: It is the default value for the METHOD attribute. The form data is sent as the URL
variable, i.e., it appends the form data into the URL. Get value should not be used for sensitive
information.
Post: The form data is sent as an HTTP post transaction and form data is not appended to the
URL. This value is used for submitting sensitive information.
<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:
118 Premium Edition-VIII

