Closed clocklear closed 11 years ago
clocklear can you please show example of using beforeNext for validation?
Something like this:
$(window).load(function() {
$(".acc-wizard").accwizard({
onBeforeNext: function(panel) {
// The thing that gets fired before you move 'forward'
// do some validation....
// return a FALSE here to prevent onNext from firing
return false;
},
onNext: function(parent, panel) {
// The thing that actually moves your wizard 'forward'
hash = "#" + panel.id;
$(".acc-wizard-sidebar",$(parent))
.children("li")
.children("a[href='" + hash + "']")
.parent("li")
.removeClass("acc-wizard-todo")
.addClass("acc-wizard-completed");
}
});
});
clocklear thank you so much for taking the time. This is a great example! I will try to put it to use today.
Thanks again!
I've added support to your library for 'beforeNext' and 'beforeBack' hooks. This will allow input validation before the user continues to the next step (or backtracks to a previous step).