Hi Daniel,
This Dojo example demonstrates how we can use the submit event to add the "required" attribute to all elements that have the "needValidation" class.
In the above Dojo, if you click on the "Submit" button the below line will select all DOM elements that have "needValidation" class and will add the "required" attribute to these elements.
$(".needValidation").attr("required", true);
After that, the form will be validated based on the presence of the "required" attribute in the different DOM elements.
There is also this line in the submit event function:
$('#ticketsForm').find("[required=\"required\"]").attr("required", false);
It removes all "required" fields before setting the same attribute to the elements that has the "needValidation" class.
I hope the above solution will help you resolve the issue in the application you are working on.
Regards,
Petar
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.