HTML <button> formactionAttribute
Example
A form with two submit buttons (with different actions). The first submit button submits the form data to "demo_form.html", the second submit button submits the form data to "demo_admin.html":
<form action="demo_form.html" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit">Submit</button><br>
<button type="submit" formaction="demo_admin.html">Submit</button>
</form>
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit">Submit</button><br>
<button type="submit" formaction="demo_admin.html">Submit</button>
</form>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Internet Explorer 10, Firefox, Opera, Chrome, and Safari support the formaction attribute.
Note:Internet Explorer 9 and earlier IE versions do not support the formaction attribute.
Definition and Usage
The formaction attribute overrides the form element'sactionattribute.
This attribute is used together with type="submit".
Differences between HTML 4.01 and HTML5
The formaction attribute is a new attribute in HTML 5.
Syntax
<button type="submit" formaction="URL">
Attribute Values
| Value | Description |
|---|---|
| URL | Specifies the address to which the form data is sent. Possible values:
|
HTML <button> Tag Other Extensions