posted 17 years ago
My application has a calender in it to select the date.I have created some validations for calender which works fine , but i want this calender should not select the previous date. can some one suggest me what extra line do i need to add in the following code:-
for (i=0; i<startDay; i++, column++)
output += '<TD WIDTH=50 HEIGHT=30><FONT SIZE=-2 COLOR="#808080" FACE="ARIAL">' + (days[lastMonth]-startDay+i+1) + '<\/FONT><\/TD>';
for (i=1; i<=days[Month]; i++, column++) {
if(column == 0){
output += '<TD WIDTH=50 HEIGHT=30>' + '<FONT SIZE=-2 FACE="ARIAL" COLOR="#808080">' + i + '<\/FONT>' +'<\/TD>';
}else if (column == 6) {
output += '<TD WIDTH=50 HEIGHT=30>' + '<FONT SIZE=-2 FACE="ARIAL" COLOR="#808080">' + i + '<\/FONT>' +'<\/TD>';
output += '<\/TR><TR ALIGN=CENTER VALIGN=MIDDLE>';
column = -1;
}else if ( i > maxDate) {
output += '<TD WIDTH=50 HEIGHT=30>' + '<FONT SIZE=-2 FACE="ARIAL" COLOR="#808080">' + i + '<\/FONT>' +'<\/TD>';
}else if ( i == opener.day ) {
output += '<TD WIDTH=50 HEIGHT=30>' + '<A HREF="javascript:changeDay(' + i + ')"><FONT SIZE=-1 FACE="ARIAL" COLOR="#FF0000"><B>' + i + '<\/B><\/FONT><\/A>' +'<\/TD>';
} else {
output += '<TD WIDTH=50 HEIGHT=30>' + '<A HREF="javascript:changeDay(' + i + ')"><FONT SIZE=-2 FACE="ARIAL" COLOR="#0000FF">' + i + '<\/FONT><\/A>' +'<\/TD>';
}
}
if (column > 0) {
for (i=1; column<7; i++, column++)
output += '<TD WIDTH=50 HEIGHT=30><FONT SIZE=-2 COLOR="#808080" FACE="ARIAL">' + i + '<\/FONT><\/TD>';
}
output += '<\/TR><\/TABLE><\/FORM><\/TD><\/TR><\/TABLE>';
return output;
}