JavaScripture
Contribute via GitHub Feedback

JavaScript FormData : Object

Use with XMLHttpRequest.send() to send form results to a server without navigating.

Constructors

new FormData() : FormData

Constructs an empty FormData.

Example:

Run

Results:

 

new FormData(form : HTMLFormElement) : FormData

Constructs a FormData using the values from the specified form.

Example:

Run

Results:

 

Instance Methods

append 2 variants
append(name : String, value : String) : undefined

Appends the name/value pair to the FormData.

Example:

Run

Results:

 

append(name : String, value : Blob, [filename : String]) : undefined

Appends the name/value as a file with the specified filename.

Example:

Run

Results: