I am trying to fill some select boxes in automatically. First question is why isn't my alert working? nothing pops up. Second I am trying to add 1 to the number that is returned in the numdays, but my loop is only 1 less than what I want. So I don't think that x is getting the correct value.
My month select boxes fill in correctly, but my year ones do not fill in. Am I storing 2003 correctly?
function fillthemin() {
var themonthchoosen;
var thecurrentyear;
var x = document.form1.numdays.value + 1;
alert(x);return false;
themonthchoosen = document.form1.select1.value;
thecurrentyear ="2003";
for(var i=1;i<=x;i++) {
document.form1["month" + i].value = themonthchoosen;
document.form1["year" + i].value = thecurrentyear;
}
}
My month select boxes fill in correctly, but my year ones do not fill in. Am I storing 2003 correctly?
function fillthemin() {
var themonthchoosen;
var thecurrentyear;
var x = document.form1.numdays.value + 1;
alert(x);return false;
themonthchoosen = document.form1.select1.value;
thecurrentyear ="2003";
for(var i=1;i<=x;i++) {
document.form1["month" + i].value = themonthchoosen;
document.form1["year" + i].value = thecurrentyear;
}
}