Re: [w3c/webcomponents] Need callback for form submit data (#187)

I think we can use ```FormData``` for this purpose regardless of form encoding.
e.g.
 - dispatch the event with an empty FormData
 - Adding an empty _type_ to each of name-value pairs in the FormData, then copy them into _form data set_

I'm not sure why @annevk thought ```FormData``` depended on ```multipart/form-data```. Actually, WebKit and Blink use a ```FormData``` object to collect values from built-in form controls. They don't store _type_ for entries in "construct the form data set" algorithm.

> Currently in the specification we gather the "form data set" after firing invalid and submit events. We'll have to move these around, but that should not be observable. I'm guessing we want to fire this after invalid, but before submit? And we want to make this cancelable too?

IMO, ```new FormData(formElement)```  should include data provided by this API. So the event should be dispatched in "construct the form data set" algorithm.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/187#issuecomment-372560417

Received on Tuesday, 13 March 2018 06:29:52 UTC