Reputation: 1
my input textbox
<input type="text" id="dateOfDiagnosisTextbox" class="form-control" />
This is my jquery
$('#dateOfDiagnosisTextbox').datepicker({
format: "dd-M-yyyy",
autoclose: true,
todayHighlight: true
});
Date of textbox should be a valid date format (dd-M-yyyy) and must be not be greater than current date otherwise system should display appropriate error message.
Upvotes: 0
Views: 3865
Reputation:
$('#dateOfDiagnosisTextbox').datepicker({
format: "dd-M-yyyy",
autoclose: true,
todayHighlight: true,
endDate: new Date()
});
Upvotes: 0
Reputation: 12181
Here you go with jsfiddle https://jsfiddle.net/or3jabbv/
$( function() {
$( "#datepicker" ).datepicker({ maxDate: "now" });
} );
Upvotes: 1