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

The last point is why we decided to use string & JSON for the value so that we can use `name` attribute of the element as done for any builtin element.

Using `FormData` is slightly nicer because it can contain multiple name-value pairs for when a compound element such as a `credit-card` component needs to submit multiple data fields.  But letting users of a component specify the value might be more valuable than each value being submitted as a separate name-value pair.  Also, user of such a component can always split the JSON into individual name-value pairs during `submit` event although having to parse the JSON there is kind of gross.

Yet anther option is to let users of component specify names for each value the component supplies but this is very different from the way builtin elements work so probably not a good idea.

-- 
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-248246155

Received on Tuesday, 20 September 2016 09:08:34 UTC