HTML <input> formactionAttribute

HTML input 标签参考手册HTML <input> Tag

Examples

An HTML form with two submit buttons (with different action values):

<form action="demo-form.php">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit"><br>
<input type="submit" formaction="demo-admin.php" value="Submit">
</form>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Firefox, Opera, Chrome, and Safari all support the formaction attribute.

Note:Internet Explorer 9 and earlier versions do not support the formaction attribute of the <input> tag.


Definition and Usage

The formaction attribute specifies the URL of the file that processes the input control when the form is submitted.

The formaction attribute overrides the <form> element'sactionattribute.

Note:The formaction attribute applies to type="submit" and type="image".


Differences between HTML 4.01 and HTML5

The formaction attribute is a new attribute in HTML5.


Syntax

<input formaction="URL">

Attribute Values

Value Description
URL Specifies the URL of the file that processes the input control when the form is submitted.

Possible values:

  • Absolute URL - the complete address of a page (for example href="http://www.example.com/formresult.html")
  • Relative URL - points to a file within the current site (for example href="formresult.html")


HTML input 标签参考手册HTML <input> Tag Other Extensions