is there any way to post form in two different urls? I am working on payment gateways and i want to post form in two urls at some conditions.
here is the code…
<h3>Page Redirection Request</h3>
<form action="https://sandbox.bankalfalah.com/SSO/SSO/SSO" id="PageRedirectionForm" class="PageRedirectionForm" method="post" novalidate="novalidate">
<input type="radio" autocomplete="off" id="TransactionTypeId" class= "TransactionTypeId" name="TransactionTypeId" value="Bank account"> Bank Account
<input type="radio" autocomplete="off" id="TransactionTypeId1" class= "TransactionTypeId" name="TransactionTypeId" value="Easypaisa"> Easypaisa
Amount: <input autocomplete="off" id="TransactionAmount" name="TransactionAmount" class="TransactionAmount" placeholder="Transaction Amount" type="text" value="5000">
<button type="submit" class="btn btn-custon-four btn-danger" id="run" class="run">RUN</button>
</form>
let me explain the whole scenario…
Its a form for payment integration.i am using two payment gateways.there are two radio options in the form as you can see.if i check bank account it should go to https://sandbox.bankalfalah.com/SSO/SSO/SSO and if i check easypaisa it should go to https://easypay.easypaisa.com.pk/easypay/Index.jsf
How it will happen?
if anyone have solution then please tell me.
i shall be very thankful.
2
Answers
You can change the
action
attribute of the form based on the data attribute of the radio button.a quick example is shown below
You can use the code below