|
If Then ElseIf using date ranges
I would appreciate any help I can get. I want to have var changed based on the date. I can get it to work with one date, but when IU want the different values for between dates, it fails.
Example is if date is <= 3/27, then a = 35
elseif date is between 3/28 & 4/6, then a = 40
else registration over.
var today = new Date();
var todaym = today.getMonth();
var todayd = today.getDate();
function calc() {
if (todaym <= 3 && todayd <= 21) {
a = document.form1.a.value;
b = a*35.00;
document.form1.total1.value = b
a0 = document.form1.a0.value;
c = a0*10.00;
document.form1.total2.value = c
a1 = document.form1.a1.value;
d = a1*10.00;
document.form1.total3.value = d
a2 = document.form1.a2.value;
e = a2*35.00;
document.form1.total4.value = e
f = b + c + d + e;
document.form1.total5.value = f;
}
else alert ("Registration closed, please register at the tournament");
}
|