473,508 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with Matt Kruse's Popup Calendar extend Disabled Dates

1 New Member
I am working with Matt Kruse's Javascript Toolbox calendar popup and have everything working correctly. However, 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.

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT LANGUAGE="JavaScript" ID="js17">
  2. var now = new Date();
  3. var cal17 = new CalendarPopup("testdiv1");
  4. cal17.setCssPrefix("TEST");
  5. cal17.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
  6. cal17.addDisabledDates("12/25/2006");
  7. cal17.addDisabledDates("Jan 1, 2008",null);
  8. </SCRIPT>
  9.  
  10. <input type="text" name="date17" value="" size=25>
  11. <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.

Edit/Delete Message
Sep 4 '07 #1
1 3682
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

You can set a date two days in advance by:
Expand|Select|Wrap|Line Numbers
  1. now.setDate(now.getDate()+2);
addDisabledDate will take two dates for a date range, so pass both formated dates to the function.
Sep 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
11179
by: C. Smith | last post by:
I am a web developer building html data entry forms that have a lot of date input fields (month, date, year) on them. I'd like to have a "popup" calendar that allows the user to pick the date using a...
4
1850
by: danilo | last post by:
This Javascript + DHTML source code able to show a popup calendar to select one date in your web pages, complete the full sourcecode and its free distribuite (GNU lic)...
2
2180
by: Daniel Wilhelm | last post by:
Hi, does someone knows a good JS PopUp Calendar for a form-field, that also shows the WeekOfYear? Thanks, Dan
3
2900
by: thegoodtimesarekillingme | last post by:
Hi. I'm looking to use Matt Kruse's calendar script to create a calendar that will automatically be written to a page. I don't need it to pop-up like he has it set. The test URL I have is as...
32
2475
by: Tom Cole | last post by:
I bet 50% of the posts I've read lately have had at least one bad thing to say about every website or book dedicated to javascript. There are clearly a few posters (you know who you are) who...
22
2234
by: settyv | last post by:
Hi, I need to write a Javascript which calculates datedifference as well as date comparision.When i try to embed the below script,it is working well,but the page is submitting even when the...
4
2952
by: ShyGuy | last post by:
A while back I had found a link to a popup calendar that had a small button that was placed to the right of any text box. By clicking on the icon and selecting a date the text box was updated with...
6
3949
by: ruraldev | last post by:
I have been trying my best to display a chosen date as dd-mm-yyyy but insert it into the mysql database as yyyy-mm-dd, I know it must be simple but no matter what I try I can't get it to work. At...
53
8315
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.