This question is locked. New answers and comments are not allowed.
I have a telerik datepicker Date0 which when selected should go and set the min value if Date1
Ideally I do not want the value to change unless it is invalid then I would like it to clear Date2.
Then I want focus to be the next control rather than Date1 having the control.
My code is below.
The only way I can get Next Field to have focus is to disable Date1.
Even when Date1 is a valid date it gets overwritten with the new Date in Date0.
Is there a way of making this work?
function onDate0Change(e) {
var value = $('#Date1').data("tDatePicker").value();
$('#Date1').data("tDatePicker").min(e.value);
if (value != null) {
if (value > e.value) {
$('#Date1').data("tDatePicker").value("");
}
else {
$('#Date1').val($.telerik.formatString('{0:dd/MM/yyyy}', value));
$('#Date1').data("tDatePicker").value($.telerik.formatString('{0:dd/MM/yyyy}', value));
}
}
else {
$('#Date1').data("tDatePicker").value("");
}
$('#NextField').focus();
}
Ideally I do not want the value to change unless it is invalid then I would like it to clear Date2.
Then I want focus to be the next control rather than Date1 having the control.
My code is below.
The only way I can get Next Field to have focus is to disable Date1.
Even when Date1 is a valid date it gets overwritten with the new Date in Date0.
Is there a way of making this work?
function onDate0Change(e) {
var value = $('#Date1').data("tDatePicker").value();
$('#Date1').data("tDatePicker").min(e.value);
if (value != null) {
if (value > e.value) {
$('#Date1').data("tDatePicker").value("");
}
else {
$('#Date1').val($.telerik.formatString('{0:dd/MM/yyyy}', value));
$('#Date1').data("tDatePicker").value($.telerik.formatString('{0:dd/MM/yyyy}', value));
}
}
else {
$('#Date1').data("tDatePicker").value("");
}
$('#NextField').focus();
}