mstratman / jQuery-Smart-Wizard

flexible jQuery plug-in that gives wizard like interface
http://mstratman.github.com/jQuery-Smart-Wizard/
304 stars 164 forks source link

Navigation through tabs when validation occurs #24

Closed cmanrique83 closed 11 years ago

cmanrique83 commented 11 years ago

Hi, Is there a way to tell the wizard that I want to keep moving through tabs after hitting a validation constrain (but without being able to submit until all validations have been taken care off), instead of being locked in the step with the validation flag?

mstratman commented 11 years ago

If I understand correctly, yes that's definitely possible.

SmartWizard doesn't have built-in validation, though, so it's up to you to code that behavior. You will want to set up an onLeaveStep handler to look at the situation and make the decision.

e.g. something like:

onLeaveStep: function(obj, context) {
    if (context.fromStep == theLastStep) {
        // return true or false, validating the last step
    } else {
        // return true or false, validating any other step
    }
}