I am using jQuery datepicker to allow the user to select the dates.
var currentTime = new Date();
var startDateFrom = new Date(currentTime.getFullYear(),currentTime.getMonth()-2);
var datePickerOptions = {
dateFormat : 'dd-MM-yy',
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
changeYear : true,
changeMonth : true,
maxDate : '0',
minDate : startDateFrom
}
$(document).ready(function() {
$('#myHeader').on( 'draw.dt', function () {
$(".datepickerColumn").datepicker(datePickerOptions);
});
})
I wanted to allow the user that in addition to select the date from datepicker, it can be entered manually also. Right now user is able to just enter the numbers, and no text and special characters like hyphen or slashes. Can anyone please help me with this. How can we allow to enter the date in a valid format. Thanks in advance