Hi,
I'm having the simplest of problems we've implemented worldpay and as you might know worldpay doesn't allow you to enter more than one item at a time.
I want to allow the user to enter say quantity 2 and then calculate the value say 15.00 and then add the result into the worldpay code.
I've been trying and I know its simple but cant get my head round it.
Please someone help. This is what I have so far.
Page1
<!-- #include file="includes/boxtop.inc" --><H1>Online Payment<br>
</H1>
<P>Make you online payment below safely using WorldPay.
</P>
<form action="payment1.asp" method="post">
<p>
<script language='javascript'>
function calcNewTotal() {
Amount = 15.00 * parseInt(document.getElementById('Qty').value);
Total = Total + Amount
document.getElementById('Total').value = Total;
}
</script>
<input type="hidden" name="Total" value="">
<input name="Quantity" type="text" id="Qty" value="<%=Quantity%>" onChange="calcNewTotal();">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<p><br>
</p>
<DIV align=left>*</DIV>
<DIV align=left>*
</DIV>
<!-- #include file="includes/boxbottom.inc" -->
Page2
<!-- #include file="includes/boxtop.inc" --><H1>Online Payment<br>
<%dim Total
Total=request.Form("Total")
%>
</H1>
<P>Make you online payment below safely using WorldPay.
</P>
<form action=" method=POST>
<p>
<input type=hidden name="instId" value="">
<input type=hidden name="cartId" value="1">
<input type=hidden name="amount" value="<%=Total%>">
<input type=hidden name="currency" value="GBP">
<input type=hidden name="desc" value="Event Payment">
<input type=hidden name="testMode" value="">
<input type=submit value="Make Payment">
<br>
</p>
</form><br>
<DIV align=left>*</DIV>
<DIV align=left>*
</DIV>
<!-- #include file="includes/boxbottom.inc" -->
Thanks for the help
I'm having the simplest of problems we've implemented worldpay and as you might know worldpay doesn't allow you to enter more than one item at a time.
I want to allow the user to enter say quantity 2 and then calculate the value say 15.00 and then add the result into the worldpay code.
I've been trying and I know its simple but cant get my head round it.
Please someone help. This is what I have so far.
Page1
<!-- #include file="includes/boxtop.inc" --><H1>Online Payment<br>
</H1>
<P>Make you online payment below safely using WorldPay.
</P>
<form action="payment1.asp" method="post">
<p>
<script language='javascript'>
function calcNewTotal() {
Amount = 15.00 * parseInt(document.getElementById('Qty').value);
Total = Total + Amount
document.getElementById('Total').value = Total;
}
</script>
<input type="hidden" name="Total" value="">
<input name="Quantity" type="text" id="Qty" value="<%=Quantity%>" onChange="calcNewTotal();">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<p><br>
</p>
<DIV align=left>*</DIV>
<DIV align=left>*
</DIV>
<!-- #include file="includes/boxbottom.inc" -->
Page2
<!-- #include file="includes/boxtop.inc" --><H1>Online Payment<br>
<%dim Total
Total=request.Form("Total")
%>
</H1>
<P>Make you online payment below safely using WorldPay.
</P>
<form action=" method=POST>
<p>
<input type=hidden name="instId" value="">
<input type=hidden name="cartId" value="1">
<input type=hidden name="amount" value="<%=Total%>">
<input type=hidden name="currency" value="GBP">
<input type=hidden name="desc" value="Event Payment">
<input type=hidden name="testMode" value="">
<input type=submit value="Make Payment">
<br>
</p>
</form><br>
<DIV align=left>*</DIV>
<DIV align=left>*
</DIV>
<!-- #include file="includes/boxbottom.inc" -->
Thanks for the help