<button type="button" >total?</button>
<?php $abc= '<div id="output"></div>';
echo $abc;?>
<form class="paypal" action="payments.php" method="post" id="paypal_form" target="_blank" runat="server">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="lc" value="UK" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest" />
<input type="hidden" name="first_name" value="Customer's First Name" />
<input type="hidden" name="last_name" value="Customer's Last Name" />
<input type="hidden" name="payer_email" value="customer@example.com" />
<input type="hidden" name="item_number" value="123456" / >
<input type="submit" value="Submit Payment"/>
</form>
<script type='text/javascript'>
$('button').click(function() {
var total = $(':checkbox:checked.case').get().reduce(function(total, checkbox) {
return total + +checkbox.value;
}, 0);
$("#output").html(total);
});
</script>
该代码包含一个按钮,用于从检查的答案中获取总和。我需要将此值传递给支付网关。
提前致谢....