Skip to content

Commit

Permalink
New pages: HTML<form>FormAction (mdn#36272)
Browse files Browse the repository at this point in the history
* New pages: HTML<form>FormAction

* New pages: HTML<form>FormAction

* New pages: HTML<form>FormAction

* Apply suggestions from code review

Co-authored-by: wbamberg <[email protected]>

* Update files/en-us/web/api/htmlinputelement/formaction/index.md

---------

Co-authored-by: wbamberg <[email protected]>
  • Loading branch information
estelle and wbamberg authored Oct 9, 2024
1 parent ef63cb0 commit 1c31c8e
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
39 changes: 39 additions & 0 deletions files/en-us/web/api/htmlbuttonelement/formaction/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "HTMLButtonElement: formAction property"
short-title: formAction
slug: Web/API/HTMLButtonElement/formAction
page-type: web-api-instance-property
browser-compat: api.HTMLButtonElement.formAction
---

{{APIRef("HTML DOM")}}

The **`formAction`** property of the {{domxref("HTMLButtonElement")}} interface is the URL of the program that is executed on the server when the form that owns this control is submitted. It reflects the value of the `<button>`'s [`formaction`](/en-US/docs/Web/HTML/Element/button#formaction) attribute.

The value overrides the {{domxref("HTMLFormElement.action", "action")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the button. This property can be retrieved or set.

## Value

A string. The URL for form submission.

## Examples

```js
btnEl.formAction = "/cgi-bin/publish";
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLButtonElement.formEnctype")}}
- {{domxref("HTMLButtonElement.formMethod")}}
- {{domxref("HTMLButtonElement.formNoValidate")}}
- {{domxref("HTMLButtonElement.formTarget")}}
- [Sending form data](/en-US/docs/Learn/Forms/Sending_and_retrieving_form_data)
43 changes: 43 additions & 0 deletions files/en-us/web/api/htmlinputelement/formaction/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "HTMLInputElement: formAction property"
short-title: formAction
slug: Web/API/HTMLInputElement/formAction
page-type: web-api-instance-property
browser-compat: api.HTMLInputElement.formAction
---

{{APIRef("HTML DOM")}}

The **`formAction`** property of the {{domxref("HTMLInputElement")}} interface is the URL of the program that is executed on the server when the form that owns this control is submitted. It reflects the value of the `<input>`'s [`formaction`](/en-US/docs/Web/HTML/Element/input#formaction) 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.

Its value overrides the {{domxref("HTMLFormElement.action", "action")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the input. This property can be retrieved or set.

## Value

A string. The URL for form submission.

## Examples

```js
inputElement.formAction = "/cgi-bin/publish";
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLInputElement.formEnctype")}}
- {{domxref("HTMLInputElement.formMethod")}}
- {{domxref("HTMLInputElement.formNoValidate")}}
- {{domxref("HTMLInputElement.formTarget")}}
- [`<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)

0 comments on commit 1c31c8e

Please sign in to comment.