Forms
E02 - Common form tags and attributes:
- E02a - (4:28)
- form - Required - includes the action attribute that specifies the url (location) of the script file (on a web server) triggered when the form is submitted.
- method and name were covered in the prior page.
- action - specifies the script to be run on the server when the form is submitted. It can also be used to send email.
- text - means a single row text box
- size - the amount of characters that can be seen in the text box (usually 15-20 depending on the browser).
- maxlength - the maximum amount of characters that can be entered.
- type=password - will hide display a dot or an asterisk for each character entered. It does not encrypt the entry, but hides the characters you have entered from others who might look at your computer monitor.
- text area - a multi-row text box
- select - is a list of selectable options that is displayed as a pull down menu or list.
- Each choice uses an option tag.
- radio - is a radio button (the round things)
- The name refers to old radios that have buttons to change stations. Only one button can be selected at a time (how could you listen to more than one radio station at a time, right?).
- Radio buttons in a form also allow you to select only one option at a time (assuming that they share the same name or id attribute).
- The name refers to old radios that have buttons to change stations. Only one button can be selected at a time (how could you listen to more than one radio station at a time, right?).
- checkbox - is just what its name implies
- One can select multiple checkboxes even if they have the same name.
- label - wrap this tag around a radio button or check box, then include in it text to be used as its label. Both the object and the text will then will be click-able.
- Some additional form options not covered:
- Selecting a file and uploading it.
- Setting the Tab Order in a Form:
- tabindex="4"
- Actual presses of the tab button vary by browser - there are often several required before the form fields are accessed.
- Adding Keyboard Shortcuts
- accesskey="k"
- form - Required - includes the action attribute that specifies the url (location) of the script file (on a web server) triggered when the form is submitted.
- E02b - (7:57)
- Please inspect the code used for the form shown below. As you look at the code you will probably be able to understand how the tags work.