W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: Request for FormData.remove() method

From: Ivan Enderlin @ Hoa <@>
Date: Fri, 27 Apr 2012 09:43:21 +0200
Message-ID: <4F9A4E19.10603@hoa-project.net>
To: public-webapps@w3.org
Hi David, Anne and others,

On 26/04/12 13:55, Anne van Kesteren wrote:
> On Wed, 18 Apr 2012 20:07:57 +0200, Bronislav Klučka 
> <Bronislav.Klucka@bauglir.com> wrote:
>> FormData can be useful not only to be sent via XHR, but essentially 
>> to hold form values easily, e.g. you can have settings form (that you 
>> do not need to send any where = you do not need to store it or you 
>> store it in e.g. IndexDb), then get this settings and alter 
>> application according to this settings... Instead of doing exactly 
>> the same, but manually
>
> Why would you not simply use a JavaScript object for this?
I recently met the following use case: create a FormData object from a 
<form />, send it to some listeners that can actually edit this 
FormData, to finally send it via a XHR to the server. Listeners can add 
some data (with FormData.append) but I would like them to be able to 
edit or remove data (for security concerns, or whatever else). The only 
solution I found is to create a new FormData-like object that mimics the 
real one but with the addition of some functions. In fact, I gently 
expose the “fields” object or array and transform it to a real FormData 
object when calling toString() or something like that.
By the way, some features are clearly missing on the FormData interface.

Best regards.

-- 
Ivan Enderlin
Developer of Hoa
http://hoa.42/ or http://hoa-project.net/

PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Received on Friday, 27 April 2012 07:43:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:52 GMT