formMethod attribute | formMethod property
Overrides the submit method attribute previously specified on a form element.
This property is read/write.
![]() ![]() |
Syntax
| HTML |
|---|
<element formMethod="sMethod" ... > |
| JavaScript |
|---|
object.formMethod = sMethod sMethod = object.formMethod |
Property values
Type: DOMString
String specifying either a "get" or a "post" method.
| Value | Condition |
|---|---|
|
Sends data as a URL variable. |
|
Sends data with an HTTP post method. |
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.19.6
Remarks
Get appends form-data into the URL in name/value pairs. The length of a URL is limited to about 3000. Get is not secure, so it shouldn't be used to send sensitive data (the data will be visible in the URL). It's best used for things like query strings. A URL with a get request can be bookmarked.
Post appends form-data inside the body of the HTTP request. The data isn't shown in the URL, and has no size limitations. A post request can't be bookmarked.
See also
Show:

