all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

formMethod attribute | formMethod property

Overrides the submit method attribute previously specified on a form element.

This property is read/write.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.19.6

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.

ValueCondition
get

Sends data as a URL variable.

post

Sends data with an HTTP post method.

 

Standards information

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

HTMLButtonElement
HTMLInputElement
input type=submit
formEnctype
formAction
formNoValidate

 

 

Show:
© 2014 Microsoft