[英]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.