I've designed a script to OnClick total the costs for a user registering for a course. Initially participants value 1 works fine. Then whenever I change the participants value to any other number the script works great. However, when I try to change the participants value back to 1 the discounts don't apply properly (it retains the discount from the previous entry). I'm sure it's just a simple error in my code, or a need to refresh but I can't find it... Any help would be appreciated.
if (document.ThisForm.participants.value=="1") {
discounts = 0;
} else {
discounts = Math.abs(document.ThisForm.subtotal.value*10)/100;
document.ThisForm.discounts.value = Math.round(discounts*100)/100;}