Web/API/FormDataEvent/FormDataEvent

From Get docs

The FormDataEvent() constructor creates a new FormDataEvent object instance.

Syntax

new FormDataEvent(type[, formEventInit]);

Values

type
A DOMString representing the name of the event.
formEventInit Optional
A FormEventInit dictionary, which can take the following optional fields:
bubbles
  • a Boolean indicating whether the event bubbles. The default is false.
  • cancelable: a Boolean indicating whether the event can be cancelled. The default is false.
  • composed: a Boolean indicating whether the event will trigger listeners outside of a shadow root (see Event.composed for more details). The default is false.
  • formData: A FormData object to pre-populate the FormDataEvent with. This would then be accessed through the FormDataEvent.formData property.

Examples

let fd = new FormData();
fd.append('test', 'test');

let fdEv = new FormDataEvent('formdata', { formData: fd });

for (let value of fdEv.formData.values()) {
  console.log(value);
}

Specifications

Specification Status Comment
HTML Living StandardThe definition of 'FormDataEvent' in that specification. Living Standard Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
FormDataEvent() constructor Chrome

Full support 77

Edge

Full support 79

Firefox

Full support 72

IE

No support No

Opera

Full support 64

Safari

No support No

WebView Android

Full support 77

Chrome Android

Full support 77

Firefox Android

No support No

Opera Android

Full support 55

Safari iOS

No support No

Samsung Internet Android

Full support 12.0

Legend

Full support  
Full support
No support  
No support


See also