Categories
- HTML Books
- HTML Colors
- HTML Characters
- HTML Tags
- <!--...-->
- <!doctype>
- <a>
- <abbr>
- <acronym>
- <address>
- <applet>
- <area>
- <b>
- <base>
- <basefont>
- <bdo>
- <big>
- <blockquote>
- <body>
- <br>
- <button>
- <caption>
- <center>
- <cite>
- <code>
- <col>
- <colgroup>
- <dd>
- <del>
- <dfn>
- <dir>
- <div>
- <dl>
- <dt>
- <em>
- <fieldset>
- <font>
- <form>
- <frame>
- <frameset>
- <h1>
- <h2>
- <h3>
- <h4>
- <h5>
- <h6>
- <head>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <isindex>
- <kbd>
- <label>
- <legend>
- <li>
- <link>
- <map>
- <menu>
- <meta>
- <noframes>
- <noscript>
- <object>
- <ol>
- <optgroup>
- <option>
- <p>
- <param>
- <pre>
- <q>
- <s>
- <samp>
- <script>
- <select>
- <small>
- <span>
- <strike>
- <strong>
- <style>
- <sub>
- <sup>
- <table>
- <tbody>
- <td>
- <textarea>
- <tfoot>
- <th>
- <thead>
- <title>
- <tr>
- <tt>
- <u>
- <ul>
- <var>
- HTML Tutorial
- HTML Software
- HTML Validator
Tools
Partners
HTML <form> Tag
Description:
The <form> tag is used to create an HTML form for user input.
A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A forms can also contain select menus, textarea, fieldset, legend, and label elements.
Specific Attributes:
| Attribute | Definition |
| action | Specifies a URI/URL of the page that will process the form. |
| method | Specifies the HTTP method to use when the form
is submitted. Possible values:
|
| enctype | Specifies the content type used to encode the
form data set when it's submitted to the server. Possible values:
|
| accept-charset | Specifies a list of character encodings that the server accepts. The default value is "UNKNOWN". |
| accept | Specifies a comma-separated list of content types that the server accepts. |
| name | Assigns a name to the form. This is used when referencing the form with stylesheets or scripts. If there are multiple forms, the name of each form must be unique. |
Other Attributes:
| Attribute | Definition |
| dir |
Specifies the text direction for the content in
an element.
|
| class | Specifies a classname for an element. |
| id | Specifies a unique id for an element. |
| lang | Specifies a language code for the content in an element. |
| target | Specifies where to open the action URL.
|
| style | Specifies an inline style for an element. |
Example Code:
<form action="" method="post">
First name: <input type="text" name="first_name" /><br />
Last name: <input type="text" name="last_name" /><br />
<input type="submit" value="Submit" />
</form>
Result



