The formaction attribute sets the URL that processes the form when a specific submit control is used. It overrides the form’s action for that click only. Use it on a <button> that submits a form, or on <input type="submit"> / type="image".
One form can offer several endpoints — for example “Save draft” and “Publish” — without duplicating fields. Pair it with formmethod or formenctype when that button also needs a different method or encoding.
Baseline · Widely available.
Not deprecated and not experimental. Stable across modern browsers since about July 2015.
Needs a form owner.
Without an associated <form> (nested or via the form attribute), a submit control with formaction does nothing.
Syntax
HTML Syntax
syntax.html
<button type="submit" formaction="URL">
Same idea on inputs: <input type="submit" formaction="URL">.
Values
Attribute Values
The value is a URL that receives the submission when that control is activated:
One line:formaction lets each submit button pick a different endpoint without cloning the form.
Frequently Asked Questions
On a submit button or input type=submit (or image), formaction sets the URL that receives the form data. It overrides the action attribute on the owning form for that submission only.
button (when it submits a form) and input with type=submit or type=image. It has no effect on type=button or type=reset.
A URL — absolute (https://…) or relative (/save, ./draft). Same rules as the form action attribute.
No. Without a form owner (nested in a form or linked with the form attribute), a submit control with formaction does nothing useful.
action is set on the form and is the default endpoint. formaction is set on a specific submit control and overrides action when that control is used.
It is Baseline widely available (since about July 2015) in modern Chrome, Firefox, Safari, and Edge.