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 IRC (such as one of these permanent autoconfirmed members) or send an e-mail to admin@wiki.whatwg.org with your desired username and an explanation of the first edit you'd like to make. (Do not use this e-mail address for any other inquiries, as they will be ignored or politely declined.)

Note: This wiki is used to supplement, not replace, specification discussions. If you would like to request changes to existing specifications, please use IRC or a mailing list first.

FormData

From WHATWG Wiki
Jump to: navigation, search

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]) — appends new entry to end of entries, normalizes Blob to File
  • boolean has(name) — basic boolean check
  • sequence<(DOMString or File)> get(name) — get all entries for name
  • void remove(name) — removes *all* entries for name

Also support iterator on the object.

XMLHttpRequest Proposal

responseType = "formdata"

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

XXX: The HTML dirname feature seems to be one way only. Maybe the feature needs to be redesigned?

XXX: If there is no name, imply "isindex"?

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.