The code given below is not working in my angular html file but if i use this code individually in an html file it works i don't know what i am doing wrong this is just a simple form .
<form action='https://easypaystg.easypaisa.com.pk/easypay/Index.jsf' method='post'> <input name='storeId' value='4950'> <input name='amount' value='1000'> <input name='postBackURL' value='https://easypaystg.easypaisa.com.pk/easypay/Confirm.jsf'> <input name='orderRefNum' value='123113'> <input name='merchantHashedReq' value='6ohsP8x3PpiaI4oNirWGwjVkyMLP4CbzcH6pZwvu9SViOzx9nLxyR/TtJhwFrxBU686Wf1z22G+TBxuo5QkSscuXp266qQWx8AbGWnLXxG79LHt+5VlD+lH2JkjKO997adwVHH6mGNm8ldtAKkRyf/E92QF5PwhWMjq8i4dlbABIjJxnwPS3x13R/Nbfmlugkz7XpX20DmZ0IhPuGBR95sOpDATIjfW51fuStCVVni4='> <input name='autoRedirect' value='0'> <input name='paymentMethod' value='CC_PAYMENT_METHOD'> <input name='emailAddr' value='[email protected]'> <input name='mobileNum' value='0123455500'> <button type="submit" class="btn btn-success" >Submit</button> <input type='submit' value='asdasd' class="btn"> </form>
Back in HTML4, the answer would be yes. Nowadays with HTML5, you are not required to specify an action attribute. If you have a form tag without an action attribute then the data will be sent to its own page.
The form action (attribute) in HTML accepts an argument. The value of the URL should be the URL. A detailed example is given to explain the form action in HTML. The action attribute was used in HTML4, but in HTML5, the action attribute is `no longer required.
The formaction attribute specifies the URL of the file that will process the input control when the form is submitted. The formaction attribute overrides the action attribute of the <form> element.
Let's learn the steps of performing multiple actions with multiple buttons in a single HTML form: Create a form with method 'post' and set the value of the action attribute to a default URL where you want to send the form data. Create the input fields inside the as per your concern. Create a button with type submit.
You can do it in following way:
<form #form action='https://easypaystg.easypaisa.com.pk/easypay/Index.jsf' method='post'> ... <button type="submit" class="btn btn-success" (click)="form.submit()">Submit</button> ... </form>
Use the ngNoForm
attribute as documented. This will prevent all "magic" Angular behavior, and you will be able to submit the form in the native way (with page reload).
So something similar to:
<form ngNoForm action='https://easypaystg.easypaisa.com.pk/easypay/Index.jsf' method='post'> <input name='storeId' value='4950'> ... <input type='submit' value='asdasd' class="btn"> </form>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With