ember.js - How to use a form component to submit to an external URL? -


i have form-tag component. needs submit outside url. i'm trying (pseudo code):

{{#form-tag action="https://foo.com/submit.aspx"}}   {{input type="hidden" value=hiddenvalue}} {{/form}} 

when form submits, need end @ https://foo.com/submit.aspx

i'm tempted use <form> element instead. wondering if there way using form component.

you can use following code component (taking advantage of attributebindings , tagname):

import ember 'ember';  export default ember.component.extend({   tagname: 'form',   attributebindings: ['action', 'method'] }); 

and can use:

{{#form-component action="https://foo.com/submit.aspx" method='post'}}   {{input type="hidden" value=hiddenvalue}}   <button type="submit">submit</button> {{/form-component}} 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -