Skip to content

Commit

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

* New pages: HTML<form>FormEnctype

* Update files/en-us/web/api/htmlbuttonelement/formenctype/index.md
  • Loading branch information
estelle authored Oct 15, 2024
1 parent 6462440 commit b44ac90
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
40 changes: 40 additions & 0 deletions files/en-us/web/api/htmlbuttonelement/formenctype/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "HTMLButtonElement: formEnctype property"
short-title: formEnctype
slug: Web/API/HTMLButtonElement/formEnctype
page-type: web-api-instance-property
browser-compat: api.HTMLButtonElement.formEnctype
---

{{APIRef("HTML DOM")}}

The **`formEnctype`** property of the {{domxref("HTMLButtonElement")}} interface is the {{Glossary("MIME_type", "MIME type")}} of the content sent to the server when the form is submitted. It reflects the value of the `<button>`'s [`formenctype`](/en-US/docs/Web/HTML/Element/button#formenctype) attribute.

The value overrides the {{domxref("HTMLFormElement.enctype", "enctype")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the submit button. This property can be retrieved or set. If not set, the value is the empty string (`""`).

## Value

A string.

## Examples

```js
btnEl.formEnctype = "application/x-www-form-urlencoded";
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

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

{{APIRef("HTML DOM")}}

The **`formEnctype`** property of the {{domxref("HTMLInputElement")}} interface is the {{Glossary("MIME_type", "MIME type")}} of the content sent to the server when the `<input>` with the `formEnctype` is the method of form submission. It reflects the value of the `<input>`'s [`formenctype`](/en-US/docs/Web/HTML/Element/input#formenctype) 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.enctype", "enctype")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the input. This property can be retrieved or set. If not set, the value is the empty string (`""`).

## Value

A string.

## Examples

```js
inputElement.formEnctype = "application/x-www-form-urlencoded";
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

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

Please sign in to comment.