Friday, 30 December 2011

HTML5 - Form Override Attributes

Form Override Attributes

The form override attributes allow you to override some of the attributes set for the form element.
The form override attributes are:
  • formaction - Overrides the form action attribute
  • formenctype - Overrides the form enctype attribute
  • formmethod - Overrides the form method attribute
  • formnovalidate - Overrides the form novalidate attribute
  • formtarget - Overrides the form target attribute
Note: The form override attributes works with the following <input> types: submit and image.

Syntax

<form action="demo_form.asp" method="get" id="user_form">
E-mail: <input type="email" name="userid" /><br />
<input type="submit" value="Submit" />
<br />
<input type="submit" formaction="demo_admin.asp" value="Submit as admin" />
<br />
<input type="submit" formnovalidate="true"
value="Submit without validation" />
<br />
</form>

Example

  <!DOCTYPE html>
<html>
<body>

<form action="demo_form.asp" method="get" id="user_form">
E-mail: <input type="email" name="userid" /><br />
<input type="submit" value="Submit" /><br />
<input type="submit" formaction="demo_admin.asp" value="Submit as admin" /><br />
<input type="submit" formnovalidate="true" value="Submit without validation" /><br />
</form>

</body>
</html>

No comments:

Post a Comment