INPUT Element:-It is an empty element specified by <INPUT> tag. It is used to provide an input field in a form where the user can enter the data. An input field may be a textfield, a checkbox, a radio button, a button, and more. INPUT element is always used within the FORM element. Thus, INPUT element defines an object on the FORM which can receive user input.
Syntax:
TYPE:The TYPE attribute determines the field type of input field to be provided in the form. Field type can be one of the following:
TEXT, PASSWORD, RADIO, CHECKBOX, SUBMIT, RESET, BUTTON, IMAGE, HIDDEN, FILE.
Syntax:
NAME:Specifies the name of the field. This name does not appear on the FORM. It is required for the identification/ differentiation as there can be more than one fields in a single FORM.
Syntax:
VALUE:Specifies the text to be displayed on the field.
Syntax:
RADIO:It provides a radio button on the form.
CHECKBOX:It provides a check box on the form.
SUBMIT:This provides a button on the form. When this button is clicked, the form is submitted to the destination.
RESET:This provides a button on the form. When this button is clicked, the input fields on the form are reset to their default state.
Syntax:
<INPUT TYPE="FieldType" NAME="FieldName" VALUE="FieldText">
Attributes of INPUT element:
TEXT, PASSWORD, RADIO, CHECKBOX, SUBMIT, RESET, BUTTON, IMAGE, HIDDEN, FILE.
Syntax:
TYPE = "FieldType"
Syntax:
NAME = "FieldName"
Syntax:
VALUE = "FieldText"
Values of TYPE attribute:
TEXT:It provides a single line text input field where the user can enter text.
PASSWORD:It provides a single line text input field where the user can enter password. A password field is different from a text field because a text field displays whatever characters are entered by the user whereas a password field shows one dot for each character input by the user. This is to prevent
others from seeing the password.RADIO:It provides a radio button on the form.
CHECKBOX:It provides a check box on the form.
SUBMIT:This provides a button on the form. When this button is clicked, the form is submitted to the destination.
RESET:This provides a button on the form. When this button is clicked, the input fields on the form are reset to their default state.
No comments:
Post a Comment