Solved

jquery date picker - limit the date selection

Posted on 2013-01-10
3
370 Views
Last Modified: 2013-01-25
Can anyone please let me know how to disable the previous dates from the current date and the next dates after the 6months (from the current date) in date picker.  I need to allow the user to select only the dates from current date and next 6 months dates, rest all dates should be disables and non select able.
0
Comment
Question by:Gangadhara Melukote
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 400 total points
ID: 38765795
Test page : http://jsfiddle.net/NGVtK/
var d = new Date();
$("#YOUR_DATEFIELD_ID").datepicker({ 
    minDate: 0,
    maxDate: new Date(d.getFullYear(), d.getMonth() +6, d.getDate())
});

Open in new window

0
 

Author Comment

by:Gangadhara Melukote
ID: 38765854
Thanks leakim971. This worked good!!
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38766601
so close the question... :(
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now