-
Notifications
You must be signed in to change notification settings - Fork 22.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New pages: HTML<form>FormMethod (#36273)
* New pages: HTML<form>FormMethod * input submission * New pages: HTML<form>FormMethod
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: "HTMLButtonElement: formMethod property" | ||
short-title: formMethod | ||
slug: Web/API/HTMLButtonElement/formMethod | ||
page-type: web-api-instance-property | ||
browser-compat: api.HTMLButtonElement.formMethod | ||
--- | ||
|
||
{{APIRef("HTML DOM")}} | ||
|
||
The **`formMethod`** property of the {{domxref("HTMLButtonElement")}} interface is the {{Glossary("HTTP")}} method used to submit the {{HtmlElement("form")}} if the {{HTMLElement("button")}} element is the control that submits the form. It reflects the value of the `<button>`'s [`formmethod`](/en-US/docs/Web/HTML/Element/button#formmethod) attribute. | ||
|
||
The value overrides the {{domxref("HTMLFormElement.method", "method")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the button. This property can be retrieved or set. If set with an empty or invalid value, the invalid default value is `"get"`. If not set at all, the value is the empty string (`""`). | ||
|
||
## Value | ||
|
||
A string; `"post"`, `"get"`, `"dialog"`, or `""`. | ||
|
||
## Examples | ||
|
||
```js | ||
btnEl.formMethod = "post"; | ||
``` | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{domxref("HTMLButtonElement.formAction")}} | ||
- {{domxref("HTMLButtonElement.formEnctype")}} | ||
- {{domxref("HTMLButtonElement.formNoValidate")}} | ||
- {{domxref("HTMLButtonElement.formTarget")}} | ||
- {{domxref("HTMLFormElement.method")}} | ||
- [Sending form data](/en-US/docs/Learn/Forms/Sending_and_retrieving_form_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: "HTMLInputElement: formMethod property" | ||
short-title: formMethod | ||
slug: Web/API/HTMLInputElement/formMethod | ||
page-type: web-api-instance-property | ||
browser-compat: api.HTMLInputElement.formMethod | ||
--- | ||
|
||
{{APIRef("HTML DOM")}} | ||
|
||
The **`formMethod`** property of the {{domxref("HTMLInputElement")}} interface is the {{Glossary("HTTP")}} method used to submit the {{HtmlElement("form")}} if the {{HTMLElement("input")}} element is the control that sumbits the form. It reflects the value of the `<input>`'s [`formmethod`](/en-US/docs/Web/HTML/Element/input#formmethod) attribute. | ||
|
||
This property is valid only for [`submit`](/en-US/docs/Web/HTML/Element/input/submit) and [`image`](/en-US/docs/Web/HTML/Element/input/image) `<input>` elements. | ||
|
||
The value overrides the {{domxref("HTMLFormElement.method", "method")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the input. This property can be retrieved or set. If set with an empty or invalid value, the invalid default value is `"get"`. If not set at all, the value is the empty string (`""`). | ||
|
||
## Value | ||
|
||
A string; `"post"`, `"get"`, `"dialog"`, or `""`. | ||
|
||
## Examples | ||
|
||
```js | ||
inputElement.formMethod = "post"; | ||
``` | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{domxref("HTMLInputElement.formAction")}} | ||
- {{domxref("HTMLInputElement.formEnctype")}} | ||
- {{domxref("HTMLInputElement.formNoValidate")}} | ||
- {{domxref("HTMLInputElement.formTarget")}} | ||
- {{domxref("HTMLFormElement.method")}} | ||
- [`<input type="submit">`](/en-US/docs/Web/HTML/Element/input/submit) | ||
- [`<input type="image">`](/en-US/docs/Web/HTML/Element/input/image) | ||
- [Sending form data](/en-US/docs/Learn/Forms/Sending_and_retrieving_form_data) |