The HTML Form Tag
Reference showing how to use the HTML Form Tag.
The Form element in HTML creates a form, this can be used to submit data to the server. The server wil handle any submitted data, with a server-side script.
Warning
Data submitted through forms should be validated on the server as well, because the client-side validation methods are easily omitted.
Atributtes
Standard atributes
| Atributte: | Value: | Description: | DTD: |
| Attrs | Other Attributes | Common, I18n, Event | STF |
| action | URI | server-side form handler | STF |
| method | GET|POST | HTTP submit method | STF |
| enctype | ContentType | STF | |
| accept | ContentTypes | list of MIME types for file upload | STF |
| name | Character Data | name of form | STF |
| onsubmit | Script | the form was submitted | STF |
| onreset | Script | the form was reset | STF |
| accept-charset | CharacterSets | list of supported charsets | STF |
| target |
| Target window of the form | TF |
DTD. Defines which document type the attribute is allowed. S=Strict, T=Transitional, F=Frameset.
Examples
Simple Example.
<form action="action.php" method="post"> </form>
Final Example
Complete Example.
<form action="action.php" method="post"> <input type="text" name="name"> <input type="text" name="email"> <textarea cols="40" rows="5" name="textmsg"></textarea> <input type="submit" value="Submit"> </form>
The complete example was included to spare you the time, of looking each entry up in the reference.