The method attribute on a <form> sets how the browser submits the form. Allowed values (case-insensitive) are get (default), post, and dialog. Pair it with action (the URL that handles the submit) and, for file uploads with POST, enctype.
A submit control can override the form for one click with formmethod. Use get for safe searches, post when data changes or must stay out of the URL, and dialog to close a parent <dialog> without a normal HTTP request.
Baseline · Widely available.
Not deprecated and not experimental. get and post are long-supported. dialog needs a supporting <dialog> (widely available in modern browsers).
POST is not encryption.
POST keeps fields out of the address bar, but data is still plain on the wire without HTTPS. Always use HTTPS for passwords and personal data.
Syntax
HTML Syntax
syntax.html
<form action="…" method="get | post | dialog">
If method is omitted, the browser uses get. With method="dialog", action is ignored.
Values
Attribute Values
Three allowed values:
Value
Description
Try it
get
Default. Appends fields to the action URL as a query string (?name=value)
It closes a <dialog> and skips the HTTP submit. Do not use it when the server must receive the data.
Compatibility
Browser Support
method is an HTML attribute on form elements in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
method
get and post are supported everywhere modern browsers run. method="dialog" works with the HTML dialog element in current Chrome, Firefox, Safari, and Edge.
97%Global support (approx.)
Google Chromeget/post: all · dialog: 37+
Full support
Mozilla Firefoxget/post: all · dialog: 98+
Full support
Apple Safariget/post: all · dialog: 15.4+
Full support
Microsoft Edgeget/post: all · dialog: 79+
Full support
Operaget/post: all · dialog: modern
Full support
Samsung InternetModern
Full support
Internet Explorerget/post: yes · dialog: no
Partial
methodWidely supported
Bottom line: Safe to use get and post everywhere. Use method="dialog" when you target browsers that support the dialog element.
Remember
Key Takeaways
Role: choose get, post, or dialog for form submit behavior.
Default: omitted method means get.
GET vs POST: query string for reads; request body for writes and secrets.
Security: POST needs HTTPS; it is not encryption by itself.
One line:method decides whether form data goes in the URL, the request body, or closes a dialog.
Frequently Asked Questions
On a form element, method chooses how the browser submits data: get (query string, default), post (request body), or dialog (close a parent dialog without a normal HTTP submit).
GET appends named fields to the action URL after ?. POST sends data in the HTTP request body. Use GET for safe searches; use POST for login, uploads, and anything that changes data.
Only the form element. A submit button can override it with formmethod for that click only.
No. POST hides values from the address bar but does not encrypt them. Use HTTPS and validate input on the server.
When the form is inside a dialog, submitting it closes the dialog, fires submit, and does not send data to an action URL. The action attribute is ignored in that case.