Submit paper- input element of a form

2,168 views
Skip to first unread message

Sachin Kumar

unread,
Aug 14, 2014, 9:48:33 AM8/14/14
to polym...@googlegroups.com
Hi,
Please tell me how to submit a form having paper element.

e.g.
<form action='', method='POST'>
               
                    <paper-input placeholder="First Name" required invalid id="paper_input" error="This Field is required" label="Type something..." class="invalid"></paper-input>
                    <paper-input placeholder="Last Name" required invalid id="paper_input1" class="invalid" label="Type something..."></paper-input>
                    <paper-input placeholder="Enter Your Email" required pattern="^(.)+@[a-z A-Z _]+?\.[a-zA-Z]{2,3}$" invalid id="paper_input2" class="invalid" label="Type something..."></paper-input>
                    <paper-input type="password" placeholder="Enter Password" required invalid id="paper_input3" class="invalid" label="Type something..."></paper-input>
                    <paper-input type="password" placeholder="Confirm Password" required invalid id="paper_input4" class="invalid" label="Type something..."></paper-input>
                    <input type="SUBMIT" name="submit"/>
                   
                </form>

Thanks

Rob Dodson

unread,
Aug 14, 2014, 2:25:18 PM8/14/14
to Sachin Kumar, polymer-dev
You'll want to use ajax to submit the element. Take a look at this StackOverflow thread: http://stackoverflow.com/questions/24461460/polymer-form-post-data

We're working on a better solution and hope to have something to show soon


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/a05917c8-fae7-46aa-a62b-953c3bedd0b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sachin Kumar

unread,
Aug 18, 2014, 2:18:23 AM8/18/14
to Rob Dodson, polymer-dev
Hi Rob,

Thanks for reply. Is it possible to submit a form in Polymer simply like we do in html or without using ajax?
--

Thanks & Regards,
Sachin Kumar
Daffodil Software pvt. ltd,
Gurgaon, Haryana

Rob Dodson

unread,
Aug 18, 2014, 2:40:42 AM8/18/14
to Sachin Kumar, polymer-dev
You can submit a form, it just won't submit values coming from custom elements. It will only work with elements that form already knows about, like input and select. To submit a form with custom elements (like paper-input) you will need to use ajax.

Nkansah Rexford

unread,
Oct 6, 2014, 9:23:26 AM10/6/14
to polym...@googlegroups.com, sac...@daffodilsw.com
Just went to check out the options in the link. I must say I'll be excited to see the paper-form introduced soon.

Rob Dodson

unread,
Oct 6, 2014, 10:38:04 AM10/6/14
to Nkansah Rexford, polymer-dev, Sachin Kumar
Take a look at ajax-form, if your custom element has a name and a value, it'll submit it for you. Pretty nice

Reply all
Reply to author
Forward
0 new messages