Solved

jquery date picker - limit the date selection

Posted on 2013-01-10
3
374 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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)

685 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