I have a multistep wizard. I need to validate some data inside one of the steps. If the validation fails I need to prevent the wizard from moving on to the next step.
Right now I'm doing this in the Next button click event of the step I'm validating:
var validator = $("#myForm").kendoValidator().data("kendoValidator");
var valState = validator.validate();
var wizard = $("#wizard").data("kendoWizard");
if(valState == true) {
//do some stuff
}
//valState was not true, so do this -- this is where I want to stop the step from moving on
wizard.select(4) //4 is the index of the current step
But this doesn't seem to work. The stepper always moves on to the next step, regardless of what step I tell the wizard to select. The validations all fire and if you go back to this step, all the error messages show. But I want the error messages to show and the Next button not to go to next, and that doesn't seem to be working. How do I make this work?