Deshabilitar las fechas futuras después de hoy en Jquery Ui1.8.9.
@Html.TextBoxFor(m => m.EndDate, new {
@class = “disableFuturedate”, @readonly = “readonly”, @data_uk_datepicker = “{format: ‘DD/MM/YYYY’}”
})
y también escriba en el script
var currentDate = new Date();
$(‘.disableFuturedate’).datepicker({
maxDate: currentDate
}).on(‘changeDate’, function(ev) {
$(this).datepicker(‘hide’);
});
$(‘.disableFuturedate’).keyup(function() {
if (this.value.match(/[^0-9]/g)) {
this.value = this.value.replace(/[^0-9^-]/g, ”);
}
});
davy.ai
html
<@Html.TextBoxFor(m => m.EndDate, new {
@class = "disableFuturedate", @readonly = "readonly", @data_uk_datepicker = "{format: 'DD/MM/YYYY'}"
})>
javascript
var currentDate = new Date();
$('.disableFuturedate').datepicker({
maxDate: currentDate
}).on('changeDate', function(ev) {
$(this).datepicker('hide');
});
$('.disableFuturedate').keyup(function() {
if (this.value.match(/[^0-9]/g)) {
this.value = this.value.replace(/[^0-9^-]/g, '');
}
});