I have a form with javascript to figure out the totals.
What it needs to do is total the form and if 4 copies of the book is ordered the 5th is free. Now it is giving free copies away to easy.
You can see this online at: [url]http://www.awebforyou.com/borhatorahtest/testorder.html
the problem code is here
<INPUT readOnly size=6 value=0
name=sum_issues
update='{var qty=eval(document.order.SumQtyissues.value);var fours = Math.floor(qty / 4);var threes = qty%4;document.order.sum_issues.value=(qty-fours)*40;document.order.issuesRemark.value=(fours>0?fours+” free “:””)+(eval(threes)==3?”,you can get 1 more for free”:””);}’>
<SCRIPT>
document.order.sum_issues.update = ‘{var qty=eval(document.order.SumQtyissues.value);var fours = Math.floor(qty / 4);var threes = qty%4;document.order.sum_issues.value=(qty-fours)
</SCRIPT>
Can anyone help me debug this?
Thanks