Are there any samples showing how to properly use custom elements within forms for submission like Addy proposed?
On Monday, June 9, 2014 2:07:12 AM UTC-7, Daniel Chin wrote: > > Hi Scott > > Thanks for your response > > I have tried coding a few scenario's to see which would work best but with > not much success each method felt like I was going down a rabbit hole. What > I really would like to do is have a custom form element which exposes a > content tag which allows me to project custom components which are really > wrapped form elements. > > <custom-form> > <custom-ui-input></custom-ui-input> > <custom-ui-button></custom-ui-button> > </custom-form> > > I would like these to also participate in form validation using html5 form > validation If possible, With response to using ajax I really don't mind. I > am just trying to determine the best approach to achieve this. > > On Wednesday, 4 June 2014 18:03:43 UTC+1, Scott Miles wrote: >> >> It's possible to recreate `form submission` (how it looks from the >> server's perspective) using AJAX. If one is willing to work this way, then >> there is an extreme amount of freedom. >> >> However, some users insist on using vanilla `<form>` element and >> requiring native input support. >> >> These use cases have different answers as to what is possible and how to >> make them go. If you can identify your needs along these lines, we can >> provide a better answer. >> >> >> On Wed, Jun 4, 2014 at 7:46 AM, Daniel Chin <[email protected]> >> wrote: >> >>> HI Guys >>> >>> I am trying to achieve the same thing >>> >>> I want to be able to create a custom form then embed my custom elements >>> inside and they participate in submission and validation. So for example >>> >>> <custom-form> >>> <custom-input></custom-input> >>> </custom-form> >>> >>> I know you can achieve similar extending elements (inputs etc) >>> >>> From what I can work out this sounds similar to what Gunter was >>> referring too, Is there a way or would this require a lot of ground work >>> what do you guys think >>> >>> Regards >>> >>> Dan >>> >>> >>> On Thursday, 10 April 2014 09:37:22 UTC+1, Addy Osmani wrote: >>>> >>>> >>>> On Wednesday, April 9, 2014, Günter Zöchbauer wrote: >>>> >>>>> I guess the most elegant way would be than to create a custom form >>>>> element <my-form> and provide it with the capabilities the DOM form >>>>> element >>>>> has and in addition with support for custom input elements like >>>>> core-input. >>>>> Custom input elements would just need to implement a specific >>>>> interface. >>>>> >>>> >>>> I've been using custom interfaces for handling forms in this manner in >>>> my own custom elements and it works. It's not the most elegant of patterns >>>> :) >>>> >>>> I think Dominic's suggestion of inserting <input> fields into yet >>>> another Shadow DOM layer should work, but you'd need to craft some >>>> additional plumbing in order to hook the values up correctly. >>>> >>>> Scott, I wonder if there's any value in us putting together some >>>> samples of how to handle forms in custom elements just for reference. >>>> There >>>> may already be good core-* elements that demonstrate this. >>>> >>>> >>>>> >>>>> >>>>> On Wednesday, April 9, 2014 8:40:20 PM UTC+2, Scott Miles wrote: >>>>>> >>>>>> `core-input` was just born yesterday, and this was a tricky decision. >>>>>> It's not set in stone. >>>>>> >>>>>> Follow Polymer on Google+: plus.google.com/107187849809354688692 >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Polymer" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/polymer-dev/dc842770-52b7-4440-9964-6d594f96dc03%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/polymer-dev/dc842770-52b7-4440-9964-6d594f96dc03%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/b4fe61a1-34ea-4ad5-9d18-66eb2b54334b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
