Submitting paper-inputs with ajax-form

547 views
Skip to first unread message

Rob Dodson

unread,
Aug 22, 2014, 10:00:09 AM8/22/14
to
Hey folks,

Just wanted to put this on your radars. A lot of folks have asked how to submit paper-inputs using the form element. Ray Nicholus, creator of ajax-form, has recently added form support for any custom element that has a name and value attribute. I'm running around on conference wifi and haven't had a chance to take it for a spin yet, but I *hope* this will help some of you get unstuck so you can start submitting those sweet, sweet, paper-* elements to your backends. Please give it a shot and comment on the issue if it doesn't work. Thanks!

Ray Nicholus

unread,
Aug 26, 2014, 10:52:03 PM8/26/14
to polym...@googlegroups.com
I did run some quick (successful) tests with paper-input.  Keep in mind that your paper-inputs must have a "name" attribute in order to be submitted along with other form fields inside of an ajax-form.  This requirement is consistent with the way a native form treats fields that lack a name attribute (it ignores them).  

ajax-form 1.0.0 will "submit" any custom element in the form if it contains a name attribute and has a value.  The next step is to respect any constraints attached to a custom form field element.  core/paper-input exposes an "invalid" property to determine if the field is valid.  In v 1.1.0, ajax-form will likely check this property on all custom form fields (in addition to validation checks iaja-form already runs on native form fields) to determine if the form can be "submitted".  It seems reasonable to carry this convention forward and expect all future custom form fields to contain an "invalid" property to make this determination as well.

Rob Dodson

unread,
Aug 27, 2014, 11:32:56 AM8/27/14
to Ray Nicholus, polymer-dev
sounds good to me!


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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/fac53ae1-b3ef-46ab-8b57-0b800e6d1daf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

ask...@gmail.com

unread,
Aug 28, 2014, 3:44:46 PM8/28/14
to polym...@googlegroups.com
I have found out an alternative way to submit paper inputs .Getting <input> tag with type hidden with name same as the paper-input and value can be binded using {{}} . So input type submit  works. 
eg.
<paper-input name="firstname" value={{first}}></paper-input>
<input type="hidden" name="firstname" value={{first}}>

Done !!:) 
Reply all
Reply to author
Forward
0 new messages