FormDataExtended

FormDataExtended

An extension of the native FormData implementation.

This class functions the same way that the default FormData does, but it is more opinionated about how input fields of certain types should be evaluated and handled.

It also adds support for certain Foundry VTT specific concepts including: Support for defined data types and type conversion Support for TinyMCE editors Support for editable HTML elements

Constructor

new FormDataExtended(form, editorsopt, dtypesopt)

Source:
Parameters:
Name Type Attributes Description
form HTMLFormElement

The form being processed

editors Array.<object> <optional>

An array of TinyMCE editor instances which are present in this form

dtypes Object <optional>

A mapping of data types for form fields

Extends

  • FormData

Members

dtypes :Object

Source:

A mapping of data types requested for each form field

Type:
  • Object

editors :Array.<object>

Source:

A record of TinyMCE editors which are linked to this form

Type:

Methods

process(form)

Source:

Process the HTML form element to populate the FormData instance.

Parameters:
Name Type Description
form HTMLFormElement

The HTML form

toObject() → {object}

Source:

Export the FormData as an object

Returns:
Type
object