hi,
i'm using the kendo datepicker but i want to add a custom validation rule to this.. how do i go about it? if i combine datepicker + validator, the validation is triggered on clicking the date calender button.
1 Answer, 1 is accepted
0
Accepted
Iliana Dyankova
Telerik team
answered on 06 Aug 2012, 07:49 AM
Hello David,
You could set a custom validation rules via the rules property of the Kendo UI Validator. For example:
<div id="MyForm">
<ul>
<li>
<input id="datepicker" required />
</li>
</ul>
</div>
<script>
$(document).ready(function() {
$("#datepicker").kendoDatePicker({});
$("#MyForm").kendoValidator({
rules: {
custom: function(input){
//debugger;
}
}
})
});
</script>
Regarding the behavior you have observed ("the validation is triggered on clicking the date calendar button") - I tried to reproduce it, but to no avail. In order to assist you best please provide some more details or even best a small but runnable project which illustrates your scenario. Thank you in advance for your cooperation.
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!