Home → References → HTML Tags →
HTML Tag: form
Defines a form allowing user-inputted data to be sent somewhere. It is used with elements such as input, select and textarea.
HTML Dog is hosted by Titan Internet
Required Attributes
actionis used to specify where the form is sent to. It must take the form of a URI.
Optional Attributes
methodcan be used to specify how the form is sent. The value must beget(default), which bolts the form values onto the URI orpostwhich invisibly sends the form data in the body of the HTTP request.enctypecan be used to specify the MIME type used to encode the form data. The default value isapplication/x-www-form-urlencoded, but this should bemultipart/form-datawhen the form contains a fileinputelement.acceptcan be used to specify which file-types (selected from a fileinputelement) should be accepted. This is a comma-separated list of MIME types.accept-charsetcan be used to specify which character sets should be accepted. This is a comma-separated list.- Common attributes
Example
<form action="/somedirectory/somformprocessingscript.php" method="post">
<div>House number: <input type="text" name="housenumber" /></div>
<div>Street: <input type="text" name="street" /></div>
<div><input type="submit" /></div>
</form>

