FormData

js.html.FormData (extern class)

The FormData interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".

Documentation FormData by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

append(name: String, value: String): Void

Appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.

Name Type
name String
value String

delete(name: String): Void

Deletes a key/value pair from a FormData object.

Name Type
name String

Returns the first value associated with a given key from within a FormData object.

Name Type
name String
Returns
haxe.extern.EitherType<Blob, haxe.extern.EitherType<Directory, String>>

Returns an array of all the values associated with a given key from within a FormData.

Name Type
name String
Returns
Array<haxe.extern.EitherType<Blob, haxe.extern.EitherType<Directory, String>>>

has(name: String): Bool

Returns a boolean stating whether a FormData object contains a certain key/value pair.

Name Type
name String
Returns
Bool

set(name: String, value: String): Void

Sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.

Name Type
name String
value String

Returns an Iteration_protocols allowing to go through all key/value pairs contained in this object.

Returns
FormDataIterator

Returns an Iteration_protocols allowing to go through all keys of the key/value pairs contained in this object.

Returns
FormDataIterator

Returns an Iteration_protocols allowing to go through all values of the key/value pairs contained in this object.

Returns
FormDataIterator

forEach(callback: Dynamic, ?thisArg: Dynamic): Void
Name Type Default
callback Dynamic
thisArg Dynamic (optional)

new(?form: FormElement): Void
Name Type Default
form FormElement (optional)