Reputation: 1542
I am using date picker in my application which should not allow user to select future date.
I could not find any function in jquery . Please give some suggestions.
I am using html 5 date input type.
<input type="date" name="bday">
Upvotes: 1
Views: 771
Reputation: 2627
Try something like this:
<input id="yourOwnId" type="date" name="bday">
Then with jquery and UI datepicker plugin for example if your future date is today:
$("#yourOwnId").datepicker({
dateFormat : 'dd/mm/yy',
maxDate : '12/10/2012
});
Or simply according to ThiefMaster:
maxDate: 0
Upvotes: 2
Reputation: 13476
Even though the question is extremely vague have a look at http://api.jqueryui.com/datepicker/#option-maxDate.
Upvotes: 0
Reputation: 318658
Assuming you are using the jQuery UI Datepicker what you are looking for is the maxDate
option. By setting it to 0
you can disallow any dates in the future.
Upvotes: 0