The formmethod attribute sets the HTTP method used when a specific submit control is activated. It overrides the form’s method for that click only. Use it on a <button> that submits a form, or on <input type="submit"> / type="image".
Common pattern: a form defaults to post for saving, while a “Search” button uses formmethod="get". The special value dialog closes an associated <dialog> without sending data to a server.
Baseline · Widely available.
Not deprecated. get and post are stable across modern browsers. The dialog value depends on <dialog> support.
GET puts data in the URL.
Do not use get (or formmethod="get") for passwords, tokens, or other secrets — they appear in the address bar and server logs.
Syntax
HTML Syntax
syntax.html
<button type="submit" formmethod="get | post | dialog">
Same attribute works on <input type="submit"> and type="image".
Values
Attribute Values
Same keywords as the form method attribute:
Value
Description
Try it
get
Append form data to the action URL (query string). Good for search
formmethod is an HTML attribute for submit controls in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
formmethod
get and post are widely available since about July 2015. The dialog value follows HTML dialog support in modern browsers.
97%Global support (approx.)
Google Chrome9+ · dialog modern
Full support
Mozilla Firefox4+ · dialog modern
Full support
Apple Safari5.1+ · dialog 15.4+
Full support
Microsoft Edge12+ · dialog modern
Full support
Opera10.6+
Full support
Samsung InternetModern
Full support
Internet Explorer10+ (no dialog)
Partial
formmethodWidely supported
Bottom line: Safe to use get/post overrides everywhere modern. Treat dialog as a progressive enhancement with the dialog element.
Remember
Key Takeaways
Role: override the form’s method for one submit control.
Values:get, post, or dialog.
GET vs POST: search/share vs changes and secrets.
dialog: closes UI only — no HTTP transmission.
One line:formmethod lets each submit button choose get, post, or dialog without cloning the form.
Frequently Asked Questions
On a submit button or input type=submit (or image), formmethod sets the HTTP method for that submission. It overrides the method attribute on the owning form.
get (append data to the URL), post (send data in the request body), and dialog (close an associated dialog without transmitting form data).
Use get for safe, bookmarkable requests like search. Use post for changes, secrets, or larger payloads that should not appear in the URL.
It closes the dialog that contains (or is associated with) the form and does not send the form data to a server.
method is set on the form and is the default. formmethod is set on a specific submit control and overrides method when that control is used.
get and post are Baseline widely available. The dialog value is supported in modern browsers that support the HTML dialog element.