A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

FormData: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
(Created page with 'Ideas around changing the FormData API. * Populate FormData from the server. (multipart/form-data entity -> FormData) * Get and manipulate FormData values. ==Proposal== * void...')
 
Line 4: Line 4:
* Get and manipulate FormData values.
* Get and manipulate FormData values.


==Proposal==
==FormData Proposal==


* void append(name, value [, filename]) — normalize Blob [+ filename] to File since it always gets a filename
* void append(name, value [, filename]) — normalize Blob [+ filename] to File since it always gets a filename
Line 11: Line 11:
* sequence<DOMString> getNames()
* sequence<DOMString> getNames()
* sequence<DOMString> getValues(name)
* sequence<DOMString> getValues(name)
==XMLHttpRequest Proposal==
responseType = "formdata"
Parse as multipart/form-data and populate FormData. Probably need to have a good definition of multipart/form-data first.
==HTML Proposal==
Something like HTMLFormElement.populate(FormData) which updates all entries with the data from FormData. Maybe it should take a dictionary to indicate whether unaffected items should be cleared or retained.


[[Category:Proposals]]
[[Category:Proposals]]

Revision as of 11:59, 14 May 2012

Ideas around changing the FormData API.

  • Populate FormData from the server. (multipart/form-data entity -> FormData)
  • Get and manipulate FormData values.

FormData Proposal

  • void append(name, value [, filename]) — normalize Blob [+ filename] to File since it always gets a filename
  • void set(name, value [, filename]) — replaces *all* name entries
  • void remove(name) — removes *all* name entries
  • sequence<DOMString> getNames()
  • sequence<DOMString> getValues(name)

XMLHttpRequest Proposal

responseType = "formdata"

Parse as multipart/form-data and populate FormData. Probably need to have a good definition of multipart/form-data first.

HTML Proposal

Something like HTMLFormElement.populate(FormData) which updates all entries with the data from FormData. Maybe it should take a dictionary to indicate whether unaffected items should be cleared or retained.