Forms are the main tool for a web site's interaction with users.
A form is marked with the <form></form> tags and it is made off one or more named controls that users can fill up. After completion of the form, a user submits the form by pressing the submit button and sends its results to the processing server. That can be a web server, e-mail server, etc...
The controls (fields) that forms might contain are:
- buttons (submit, reset or regular push button)
- text fields
- text areas
- checkboxes
- radio buttons (different from above mentioned buttons)
- menus and lists
- file selects
- hidden controls
- object controls (via <object> element)
Besides acting as a holding container, the form open tag (<form>) also defines the action to be taken upon submission (action attribute), the method which will be used for sending the data to the server (method attribute) and the character encoding (accept-charset attribute).
Syntax:
<form><input type="" name="" /><input type="submit" name="" /></form>
Attributes:
- id, class (document-wide identifiers)
- lang (language information), dir (text direction)
- title (element title)
- style (inline style information)
- target (target frame information)
- action, method, enctype, accept-charset, accept (form - server communication)
- name (elements name)
- onsubmit, onreset, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)
Example
HTML form elements:
Comments
No comments have been made yet.
Please login to leave a comment. Login now