Solved

jquery date picker - limit the date selection

Posted on 2013-01-10
3
369 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
Comment Utility
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
Comment Utility
Thanks leakim971. This worked good!!
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
so close the question... :(
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
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 invoke it on a web page. 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.: (CODE)

763 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

11 Experts available now in Live!

Get 1:1 Help Now