My code works under MS IE6,
but not work on Firefox and Mac IE5.1.2
Mac IE5.1.2 response: 'options' is not an object
function to check leap year
Source code:
--------------------------------------------------------------------
function setStartDayOpt() {
var year = document.getElementById('startYear');
var month = document.getElementById('StartMonth');
var day = document.getElementById('startDay');
var i, j, m, y, temp;
m = month.options[month.selectedIndex].value;
y = year.options[year.selectedIndex].value
if (year && month && day) {
if (m==4 || m==6 || m==9 || m==11) {
i=30;
} else {
i=31;
}
if (m==2) {
if (y/4 == parseInt(y/4)) {
i = 29;
} else {
i = 28;
}
}
if (day.options.length == j) {
return false;
} else {
day.options.length = 0
}
for (j=0; j<i; j++) {
temp = new Option(j+1, j+1);
alert(temp);
day.options[j] = temp;
temp = null;
}
}
}
------------------------------------------------------------------------------------------
Please advise, thanks.