function AddAmount(checkbox)
{
var action = "";
var dGift = 5;
if (checkbox.checked)
{
action = "A";
}
else
{
action = "S";
}
calculateTotal(gift, action)
}
<input type="checkbox" name="txtBwayEDUGift" onchange="checkboxAdd(this);" checked="checked" />
<script type="text/javascript">
function checkboxAdd( ctl ){
if(ctl.checked == true ){
calculateTotal(5, "A");
} else {
calculateTotal( 5, "S");
}
}
It appears the functionality is there and is working to an extent. But instead of adding the $5.00 charge to the order, it is instead keeping the orginal amount and only reducing the amount when unchecked. It is not adding the $5.00 to the order amount when checked. Please see my screenshots attached. With the $5.00 added the order amount should be $1,126.00 in my example. I hope this makes sense. Please help in anyway possible. thank you.
</script>
Open in new window
HTML CODE -
Open in new window