I
itcassy
I have posted my question on a couple other sites and have not
received any response. I desperately need to get this calendar
finished for a hospital. I did get a little help on the webmasters
forum, but unfortunately, it did not work.
I am working with Matt Kruse's Javascript Toolbox calendar popup and
have everything working correctly. I need to not only disable today's
date, but also the next two days. For the form I am working on, they
do not want people to be able to pick a date earlier than 3 days in
advance. I would appreciate any help anyone can provide. I cannot
figure out how to add more time to the disabled portion of the script.
The form script is below:
Dates disabled: Anything up to today, December 25, 2007, and anything
after January 1, 2008.
<SCRIPT LANGUAGE="JavaScript" ID="js17">
var now = new Date();
var cal17 = new CalendarPopup("testdiv1");
cal17.setCssPrefix("TEST");
cal17.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
cal17.addDisabledDates("12/25/2006");
cal17.addDisabledDates("Jan 1, 2008",null);
</SCRIPT>
<input type="text" name="date17" value="" size=25>
<A HREF="#"
onClick="cal17.select(document.forms[0].date17,'anchor17','MM/dd/
yyyy'); return false;"
TITLE="cal17.select(document.forms[0].date17,'anchor17','MM/dd/yyyy');
return false;" NAME="anchor17" ID="anchor17">select</A>
And the javascript can be referenced at: http://www.mattkruse.com/javascript/calendarpopup/
Thank you in advance for any help.
-------------------------------------------------------------------------------------------
The person on the other forum posted a revision to the code, but that
does NOT work
Untested, but try this. My lines indented for clarity:
<SCRIPT LANGUAGE="JavaScript" ID="js17">
var now = new Date();
var tomorrow = new Date();
tomorrow.setTime(now.getTime() + 86400000)
var dayftertomorrow = new Date();
dayftertomorrow.setTime(now.getTime() + 172800000)
var cal17 = new CalendarPopup("testdiv1");
cal17.setCssPrefix("TEST");
cal17.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
call7.addDisabledDates(null,formatDate(tomorrow,"yyyy-MM-dd"));
call7.addDisabledDates(null,formatDate(dayaftertomorrow,"yyyy-MM-
dd"));
cal17.addDisabledDates("12/25/2006");
cal17.addDisabledDates("Jan 1, 2008",null);
</SCRIPT>
Any suggestions from anyone?
received any response. I desperately need to get this calendar
finished for a hospital. I did get a little help on the webmasters
forum, but unfortunately, it did not work.
I am working with Matt Kruse's Javascript Toolbox calendar popup and
have everything working correctly. I need to not only disable today's
date, but also the next two days. For the form I am working on, they
do not want people to be able to pick a date earlier than 3 days in
advance. I would appreciate any help anyone can provide. I cannot
figure out how to add more time to the disabled portion of the script.
The form script is below:
Dates disabled: Anything up to today, December 25, 2007, and anything
after January 1, 2008.
<SCRIPT LANGUAGE="JavaScript" ID="js17">
var now = new Date();
var cal17 = new CalendarPopup("testdiv1");
cal17.setCssPrefix("TEST");
cal17.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
cal17.addDisabledDates("12/25/2006");
cal17.addDisabledDates("Jan 1, 2008",null);
</SCRIPT>
<input type="text" name="date17" value="" size=25>
<A HREF="#"
onClick="cal17.select(document.forms[0].date17,'anchor17','MM/dd/
yyyy'); return false;"
TITLE="cal17.select(document.forms[0].date17,'anchor17','MM/dd/yyyy');
return false;" NAME="anchor17" ID="anchor17">select</A>
And the javascript can be referenced at: http://www.mattkruse.com/javascript/calendarpopup/
Thank you in advance for any help.
-------------------------------------------------------------------------------------------
The person on the other forum posted a revision to the code, but that
does NOT work
Untested, but try this. My lines indented for clarity:
<SCRIPT LANGUAGE="JavaScript" ID="js17">
var now = new Date();
var tomorrow = new Date();
tomorrow.setTime(now.getTime() + 86400000)
var dayftertomorrow = new Date();
dayftertomorrow.setTime(now.getTime() + 172800000)
var cal17 = new CalendarPopup("testdiv1");
cal17.setCssPrefix("TEST");
cal17.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
call7.addDisabledDates(null,formatDate(tomorrow,"yyyy-MM-dd"));
call7.addDisabledDates(null,formatDate(dayaftertomorrow,"yyyy-MM-
dd"));
cal17.addDisabledDates("12/25/2006");
cal17.addDisabledDates("Jan 1, 2008",null);
</SCRIPT>
Any suggestions from anyone?