Prevent submit when kendo upload has validation error

1 Answer 344 Views
Upload
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Benjamin asked on 31 Jan 2023, 09:34 AM
I would like to know how to prevent form submission when the kendo upload has a validation error. I know I can disable the submit button, but I would prefer when the button is clicked to run a validation check, if there is validation, return false on something similar.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 03 Feb 2023, 07:07 AM

Hi Benjamin,

You can validate the Kendo UI Upload component on form submit by using the Kendo UI Validator. To validate whether a file is selected and that the selected file has the correct extension, create a custom rule for the Validator.

Please check out the following example demonstrating this in a runnable demo:

Please let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Upload
Asked by
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Nikolay
Telerik team
Share this question
or