Hello Mike,
In the example the Kendo UI Validator connects to the controls containing the required attribute on button click as seen in this screen recording. However, the required attribute in the controls by default shows the built-in message before connecting it with the Kendo UI Validator.
In order to show the Validator when the button is clicked, add the required attribute in the controls within the button's onclick() function as seen below:
$("#save").click(function() {
$("#new").attr("required", "true");
$("#NewOrUsed").attr("required", "true");
});
Use the validate method to check whether all the validation rules have passed and the errors method to display the messages for the failed validation rules. For example:
$("#save").click(function() {
if (validatable.validate() === false) {
var errors = validatable.errors();
}
});
Please take a look at this updated Dojo sample where the Validator message is displayed when the button is clicked.
Please let me know if this is something that you're looking for. If not, could you please reply with more details of what you're trying to achieve?
I look forward to your reply.
Regards,
Hetali
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.