This is a migrated thread and some comments may be shown as answers.

[Solved] how can I rollback the changed date of datepicker

0 Answers 14 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
didem
Top achievements
Rank 1
didem asked on 19 Jul 2010, 07:11 PM
how can I rollback the changed date of datepicker?
I have created a datepicker as;

                        <%: Html.Telerik().DatePickerFor(model => model.dateINI).Name("dateINI")
                            .ClientEvents( events => events
                                                    .OnChange("check")
                                                                            )
                                                    %>
I want to rollback if the new changed date is not between of two values;

function check(e) {
            var minValue = document.getElementsByName("minText")[0].value;
            var maxValue = document.getElementsByName("maxText")[0].value;
           
            if (e.date.format("dd/MM/yyyy") < minValue || e.date.format("dd/MM/yyyy") > maxValue) {
                alert("Date must be between min and max!");
                //e.selectedDate=e.previousDate;
            }
}
But "e.selectedDate=e.previousDate;" line does not work.

Thanks...
        
Tags
General Discussions
Asked by
didem
Top achievements
Rank 1
Share this question
or