HTML Attributes
HTML formaction attribute
Overrides the associated form's submission destination for this submit button or image submit input. Applicable elements include: <button>, <input>. Check each element’s value rules. Example uses illustrative URLs or local assets; provide the corresponding files or application endpoints when running it. The override applies to a submit button or eligible submit/image input when that control is the submitter. A different submitter can use a different destination; the form action otherwise supplies the default. A relative URL resolves against the document base URL.
Formal Syntax & Structure
html syntaxhtml
formaction="/preview"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| formaction | URL | Overrides the associated form's submission destination for this submit button or image submit input. |
Working Example
Example Snippethtml
<form action="/save"> <button formaction="/preview">Preview</button> <button>Save</button></form>Browser Compatibility
Minimum supported versions across modern rendering engines
Blink (modern)
Chrome
9
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
4
Yes
WebKit
Safari
5
Yes
Presto / Blink
Opera
≤12.1
Yes
Desktop support for formaction on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard