The action attribute on a <form> sets the URL that processes the form submission. Use a relative path (like /search) or an absolute URL (like https://example.com/api).
Pair it with method (get or post). A submit control can override the destination with formaction. When method="dialog", action is ignored.
Baseline · Widely available.
Not deprecated and not experimental. Standard form attribute across modern browsers since about July 2015.
Syntax
HTML Syntax
syntax.html
<form action="URL"> … </form>
URL may be absolute, relative to the current page, or empty (current document).
Preview sets formaction="/preview", which wins for that click.
Same field data — only the destination URL changes.
Edge Cases & Pitfalls
Most issues are “wrong URL” or “wrong override,” not syntax.
dialog
Ignored with method="dialog"
In a <dialog>, that method closes the dialog without navigating — action does nothing.
override
formaction wins on that button
Check submit buttons and input type="submit|image" for a formaction that replaces the form action.
empty
Empty means current page
action="" or omitting action submits to the document URL — useful, but easy to overlook when debugging.
GET
GET puts data in the URL
Do not use GET for passwords or large payloads. Prefer method="post" for updates.
HTTPS
Prefer secure endpoints
Submit sensitive forms to https:// URLs so credentials and data are not sent in clear text.
Compatibility
Browser Support
action is an HTML form attribute in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
action
Widely available since about July 2015. Supported everywhere forms are supported.
99%Form attribute support
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetAll modern
Full support
Internet ExplorerAll versions with forms
Supported
actionWidely supported
Bottom line: Safe to use in every modern browser. Remember: formaction can override it, and method="dialog" ignores it.
Remember
Key Takeaways
Role: URL that receives the submitted form.
Values: absolute URL, relative path, or empty (current page).
Overrides:formaction on a submit control replaces action.
With method: GET appends a query string; POST uses the request body.
One line:action is where the form goes — unless a button’s formaction says otherwise.
Frequently Asked Questions
On a form, action sets the URL that processes the submitted data. Relative paths resolve against the current page; absolute URLs point to a full address.
The form typically submits to the current page URL. An empty action="" also means the current document URL.
Yes. A submit control can set formaction, which overrides the form’s action for that click.
When method="dialog" is set, the form closes a dialog instead of navigating, so action is ignored.
With method="get" (default), field data is appended to the action URL as a query string. With method="post", data goes in the request body to that URL.
No. It is a standard form attribute and Baseline widely available.