- Original Poster
- #1
I want to give a free product to my customers, all i want is for them to pay the postage via worldpay
I have the following form, and im trying to get a dropdown option to calculate with a text input field then put the total into another field before submitting the result, anyone have any ideas how i can achieve this please
I have the following form, and im trying to get a dropdown option to calculate with a text input field then put the total into another field before submitting the result, anyone have any ideas how i can achieve this please
Code:
<form action="rbsworldpay/wcc/purchase" method=POST>
<input type=hidden name="instId" value="yourid">
<input type=hidden name="cartId" value="cartid">
<!-- If debit card seleted then add 0 to total price -->
<!-- If credit card seleted then add 2.50 to total price -->
<select id="cardtype" name="cardtype" onchange="calculateTotal()">
<option value="None">Select your card type</option>
<option value="0">Debit Card</option>
<option value="2.5">Credit Card</option>
</select>
<!-- amount inputed by user -->
Please enter the Amount you are Paying
<input style="border: 1px solid #cccccc;" name="amountpaying" type="text" value="" />
<!-- field total to send to worldpay **** can be hidden -->
<input style="border: 1px solid #cccccc;" name="amount" type="text" value="" />
<input name="currency" type="hidden" value="GBP" />
<input type="submit" value="Confirm you Payment" />
</form>
</form>