Solved

jquery date picker - limit the date selection

Posted on 2013-01-10
3
376 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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)
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…

726 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