jquery - How use ajax-forms with polymer? -
i'm trying create simple web app using polymer.
i have email, name , checkbox field user.
what when user enters information these inputs, data stored , sent me.
i understand may novice question, finding difficulty work polymer framework.
below code. html
<paper-input-decorator id="decorator" label="{{label}}" floatinglabel="{{floatinglabel}}" value="{{value}}" disabled?="{{disabled}}"> <input is="core-input" value="{{value}}" committedvalue="{{committedvalue}}" on-change="{{changeaction}}" method="post" disabled?="{{disabled}}"> </paper-input-decorator>
html
<link rel="import" href="../../bower_components/ajax-form/ajax-form.html"> <link rel="import" href="../../bower_components/paper-button/paper-button.html"> <link rel="import" href="../../bower_components/paper-input/paper-input.html"> <form id="dosomethingform" is="ajax-form" action="/api/dosomething" method="post"> <paper-input label="name" type="text" name="name"></paper-input> <paper-input label="email" type="text" name="email"></paper-input> <paper-button id="submitbutton" raised on-tap="{{submit}}">submit</paper-button> </form>
javascript
polymer({ submit: function() { this.$.dosomethingform.submit(); } });
this send post call server on endpoint /api/dosomething
parameters name
, email
Comments
Post a Comment