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

Hi everyone,

FWIW, I really like the proposal A, having an API to make any object participant of a form would be an awesome feature! :)

That being said, in that proposal, the way a custom element is registered as a form participant seems quite cumbersome and complicated. I'm wondering if you have though about a declarative way of doing that. For instance, instead of this quite complicated `connectedCallback` why can't we use the markup/attributes to express that ? Something like:

```html
<form id="my-form">
<!-- ... -->
  <my-control participant="name-in-the-form-data" />
  <!-- not name="name-in-the-form-data" because of <a name=""> -->
</form>
<!--  and even -->
<another-control participant="another-name" form="my-form" />
```

the browser would then be responsible for calling `addParticipant`. Also, with that, we could imagine that you don't need to handle the disabled state in the `formDataCallback` because the browser would not called it if the custom element is disabled.

Cheers

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

Received on Wednesday, 28 February 2018 06:20:56 UTC