|
Hello,
I am trying to de-activate past dates on this script, so that when a user tries to click on any date before the present date on the calendar, it will not be clickable.
I believe it can be altered somewhere in this block of code:
if (this.disabledWeekDays[col-1]) {
date_class="calnotclickable";
result += ' <TD CLASS="'+td_class+'"><SPAN CLASS="'+date_class+'">'+display_date+'</SPAN></TD>\n';
}
else {
var selected_date = display_date;
var selected_month = display_month;
var selected_year = display_year;
if (this.displayType=="week-end") {
var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);
d.setDate(d.getDate() + (7-col));
selected_year = d.getYear();
if (selected_year < 1000) { selected_year += 1900; }
selected_month = d.getMonth()+1;
selected_date = d.getDate();
}
result += ' <TD CLASS="'+td_class+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CalendarPopup_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+display_date+'</A></TD>\n';
}
I got the script from:
http://www.mattkruse.com/javascript/calendarpopup/
Has anyone used this script and tried to disable dates before present?
Help please, I have been on this for 4 days and not getting anywhere.
Thank you,
Toad
|
|
|
|
|
|
|
|