HTML Form
HTML forms are used to collect user input. The element defines an HTML form: Form elements are different types of input elements, checkboxes, radio buttons, submit buttons, and more.. form elements.
The Element The element is the most important form element. The element has many variations, depending on the type attribute. Here are the types used in this chapter: TypeDescription textDefines normal text input radioDefines radio button input (for selecting one of many choices) submitDefines a submit button (for submitting the form)
Input Type: text defines a one-line input field for text input: First name: Last name:
Input Type: radio defines a radio button. Radio buttons let a user select ONE of a limited number of choices: Male Female
Input Type: checkbox defines a checkbox. Checkboxes let a user select ZERO or MORE options of a limited number of choices. I have a bike I have a car
Input Type: password defines a password field: User name: User password:
Input type: submit defines a button for submitting a form to a form-handler. The form-handler is typically a server page with a script for processing input data. The form-handler is specified in the form's action attribute: First name: Last name:
The Element (Drop-Down List) The element defines a drop-down list: Volvo Saab Fiat Audi
Input Type: button defines a button:
Input Type: number The is used for input fields that should contain a numeric value. You can set restrictions on the numbers. Depending on browser support, the restrictions can apply to the input field. Quantity (between 1 and 5):
The elements Volvo Saab Fiat Audi
The Element The element defines a multi-line input field (a text area): The cat was playing in the garden.
The Element The element defines a clickable button: Click Me!
HTML Input Attributes The value Attribute – The value attribute specifies the initial value for an input field: First name: Last name:
The readonly Attribute The readonly attribute specifies that the input field is read only (cannot be changed): First name: Last name:
The disabled Attribute The disabled attribute specifies that the input field is disabled. A disabled element is un-usable and un-clickable. Disabled elements will not be submitted. First name: Last name:
The size Attribute The size attribute specifies the size (in characters) for the input field: First name: Last name:
The maxlength Attribute The maxlength attribute specifies the maximum allowed length for the input field: First name: Last name:
Resources w3schools.com
Practical Please see practical #5 on my website