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

Override/Cancel default Form validation.

3 Answers 358 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Satish
Top achievements
Rank 1
Satish asked on 02 May 2012, 06:23 PM
I'm using validator to validate my html form. My form has two submit buttons Save and Cancel. So now if I click the cancel button it does a validation and prevents the submit. Is it possible to disable of bypass this behavior so that cancel will submit the form without validation?

3 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 07 May 2012, 09:28 AM
Hello Satish,

You may consider not using the automatic validation when form is submitted (by not attaching the KendoUI Validator to the form element but to some other container) and handle the validation on the button click as shown in this online demo.

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Howard
Top achievements
Rank 1
answered on 19 Jun 2013, 05:41 AM
you can do that by calling this function in your cancel button click
validator.destroy();
but bear in mind that your form will be submitted to the controller
0
Helpdesk
Top achievements
Rank 1
answered on 17 Jun 2015, 12:58 PM

Incase you did not know how to use the destroy

    var validatable = $("form").kendoValidator().data("kendoValidator"); 

    $("#btnCancel").click(function () {
        validatable.destroy();
    });

Tags
Validation
Asked by
Satish
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Howard
Top achievements
Rank 1
Helpdesk
Top achievements
Rank 1
Share this question
or