简体   繁体   English

如何使用Angular 7从Form提交操作链接?

[英]How can i submit action link from Form using Angular 7?

How can achieve this in angular 7? 如何在角度7中做到这一点? how can submit this post action url in angular? 如何以角度提交此后操作网址?

<form method="post" action="https://securegw- 
stage.paytm.in/order/process" name="paytm">
     <table border="1">
        <tbody>
           <input type="hidden" name="MID" value="YOUR_MID_HERE">
        </tbody>
     </table>
     <script type="text/javascript">
        document.paytm.submit();
     </script>
  </form>

Please help... thank you... 请帮忙...谢谢...

Can you try with selecting form in Component then call submit on nativeElement ? 您可以尝试在Component中选择表单,然后在nativeElement上调用Submit吗?

@ViewChild('paytmForm', { read: ElementRef }) paytmForm: ElementRef; 

ngAfterContentInit() {
   this.paytmForm.nativeElement.submit()
}

In template add #paytmForm on form element 在模板中,在表单元素上添加#paytmForm

<form method="post" action="https://securegw- 
stage.paytm.in/order/process" name="paytm" #paytmForm >
...
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用angular使用POST操作提交表单 - Submit a form with POST action using angular 如何使用angular js在提交操作中获取所有选中的复选框值? - how can i grab all selected check box values on submit action using angular js? 如何将表单提交操作从显示警报弹出窗口更改为重定向到新页面? - How can I change a form submit action from displaying an alert popup to redirecting to a new page? Casperjs:如何提交具有action =“#”的表单 - Casperjs: how can I submit a form that has action=“#” 单击按钮提交时如何禁用操作表单? - How can I disable action form when click button submit? 如何防止表单提交操作被触发? - How can I prevent form submit action to be triggered? 如何在没有表单的情况下使用Jquery提交有关链接单击的页面? - How can I submit a page on link click using Jquery without the presence of a form? 如何使用 JavaScript 提交表单? - How can I submit a form using JavaScript? 通过提交按钮执行表单操作,具体取决于<a>使用JavaScript从另一个页面选择</a>的&#39; <a>&#39;链接</a> - Performing form action via submit button depending on the '<a>' link chosen from another different page using javascript 如何传递链接的URL作为模式形式的动作? - How can I pass the URL of a link as the action for a modal form?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM