wbotelhos/stepy

How to validate the current step

Closed this issue · 1 comments

In your examples at http://wbotelhos.com/stepy one can see that you have something like:

$('#step').stepy({
    next: function(index) {
        if (!isValid()) {
          alert('Invalid random value!');
          return false;
        }
        alert('Going to step ' + index + '...');
   }
});

but I get an error that isValid() is not defined, tried to find in the source code and there is no such method to be called publicly. How can I validate the current step?

Hi @balexandre,

That functions is just a example where you can decide to return true to continue the step or false to stop that.
You should create you own function and decide it.
The validation is executed automatically, but you can implement your own together.