The HTML Form Element

Posted The: 15/08/2008 At: 17:41

Last Edited: 30/04/2009 At: 20:55

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:
AttrsOther AttributesCommon, I18n, EventSTF
actionURIserver-side form handlerSTF
methodGET|POSTHTTP submit methodSTF
enctypeContentTypeSTF
acceptContentTypeslist of MIME types for file uploadSTF
nameCharacter Dataname of formSTF
onsubmitScriptthe form was submittedSTF
onresetScriptthe form was resetSTF
accept-charsetCharacterSetslist of supported charsetsSTF
target
  • _self
  • _blank
  • _parent
  • _top
Target window of the formTF

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.

Comments: [0]

© Brugbart Webdesign