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
Post a Comment