HTML <form> tag
Definition and Usage
The form element creates a form for user input. A form can contain
textfields, checkboxes, radio-buttons and more. Forms are used to pass
user-data to a specified URL.
Differences Between HTML and XHTML
NONE
Example
| Source |
Output |
<form
action="form_action.asp"
method="get">
First name:
<input type="text" name="fname" value="Mickey"
/>
<br />
Last name:
<input type="text" name="lname" value="Mouse"
/>
<br />
<input type="submit" value="Submit" />
</form>
<p>
If you click the "Submit" button, you will send your input to a new page
called form_action.asp.
</p> |
If you click the "Submit" button, you will send your input to a new page called
form_action.asp.
|
Required Attributes
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| action |
URL |
A URL that defines where to send the data when the submit button
is pushed |
STF |
Optional Attributes
| Attribute |
Value |
Description |
DTD |
| accept |
list of contenttypes |
A comma separated list of content types that the server
that processes this form will handle correctly |
STF |
| accept-charset |
charset_list |
A comma separated list of possible character sets for the
form data. The default value is
"unknown" |
STF |
| enctype |
mimetype |
The mime type used to encode the content of the form |
STF |
| method |
get
post |
The HTTP method for sending data to the action URL. Default
is get. method="get": This method sends the form contents
in the URL: URL?name=value&name=value. Note: If the form values contains non-ASCII characters or
exceeds 100
characters you MUST use method="post".
method="post": This method sends the form contents in the body of the request.
Note: Most browsers are
unable to bookmark post requests.
|
STF |
| name |
form_name |
Defines a unique name for the form |
TF |
| target |
_blank
_self
_parent
_top |
Where to open the target URL.
- _blank - the target URL will open in a new window
- _self - the target URL will open in the same frame as it was clicked
- _parent - the target URL will open in the parent frameset
- _top - the target URL will open in the full body of the window
|
TF |
Standard Attributes
| id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard
Attributes.
Event Attributes
| onsubmit, onreset, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup |
For a full description, go to Event
Attributes.
Try-It-Yourself Demos
Form with
input fields and a submit button
How to add a form to a page. The form contains two input fields and a submit
button.
Form with
checkboxes
This form contains two checkboxes, and a submit button.
Form with
radiobuttons
This form contains two radio buttons, and a submit button.
Send e-mail
from a form
How to send e-mail from a form.
 |
 |
 |
 |
|
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |
 |
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |
 |
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Utilize the extensive out-of-the box features or customize your site through Ektron CMS400.NET's open architecture |
 |
Promote collaboration in your organization through project workspaces where others can efficiently find information and work together |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
|
|
 |
TAKE THE VIDEO TOUR |
 |
or download a FREE TRIAL today. |
|