HTML Attributes
HTML formmethod attribute
Overrides the form submission method for a particular submit control. dialog closes an associated dialog instead of making an ordinary network submission. 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. Supported submission methods include get, post and dialog in the appropriate context. GET encodes form data into the URL query, POST sends it in the request body, and dialog closes an associated dialog rather than issuing an HTTP request. The attribute does not enable arbitrary HTTP verbs.
Formal Syntax & Structure
html syntaxhtml
formmethod="get"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| formmethod | enumerated: get, post, dialog | Overrides the form submission method for a particular submit control. dialog closes an associated dialog instead of making an ordinary network submission. |
Working Example
Example Snippethtml
<form action="/search"> <label> Query <input name="q"> </label> <button formmethod="get">Search</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 formmethod on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard