Form
A form is a region that contains form elements.
Form elements are elements that allow users to enter information in a table consignments (such as a text field, drop-down list, radio box, check box, and so on).
The form is defined using the form label (<form>).
<form>, ..... INPUT element ...</form>
Input
In most cases, the form label used is the input label (<input>). The input type is defined by the type attribute. Most of the input types that are often used are as follows:
Text fields
A text field is used when a user wants to type something like letters, numbers, and so on in a form.
<input type="text" name="firstname" /><input type="text" name="lastname" /></form>
The browser appears as follows:
Notice that the form itself is not visible. Also, in most browsers, the default width of a text field is 20 characters.
Radio button (Radio Buttons)
A radio box is used when a user chooses one of several given choices.
<form> <input type="radio" name="sex" value="male" /> male<br/> <input type="radio" name="sex" value="female" /> female</form>
The browser appears as follows:
Note that you can only select one of these.
check box (checkboxes)
The check box is used when the user needs to select one or several options from several given selections.
<form> <input type="checkbox" name="bike" /> i has a bike<br/> <input type="checkbox" name="car" /> I have a car</form>
The browser appears as follows:
Action Property (action) and confirmation button for the form
When the user clicks the Confirm button, the contents of the form are transferred to another file. The action properties of the form define the file name of the destination file. This file, which is defined by the action attribute, is usually processed in connection with the input data received.
action="html_form_action.asp" method="get">Username: <input type= "text" name= "user"/> <input type="submit" value="Submit" /> </form>
The browser appears as follows:
If you type a few letters in the text box above and click the Confirm button, the input data will be transferred to the "html_form_action.asp" page. The page will display the results of the input.
Html-notes2 form