Page 133 - iPro_trackGPT_V5_Class7
P. 133
(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.
• SUBMIT: This value is used to create a submit button control. The submit button control is
used to submit all the entered values in the 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 like a
text box field. The only difference is that the text entered in the password field will not be
readable because it appears in the form of star symbols.
VALUE: This attribute is used to specify the default value of the field.
More on HTML 131

