I'm trying to use the jQuery Wizard SmartEizard 3.0 which has a 'goToStep' method allowing you to jump to a given step based on a logic. I tried it with the below code but it seems to get stuck in an infinite loop and never goes to the next step. Can anyone spot what i'm doing wrong here?
$(document).ready(function () {
// Smart Wizard
$('#wizard').smartWizard({
enableFinishButton: false,
onLeaveStep:onLeaveStepFunction,
onFinish:onFinishCallback
});
function onLeaveStepFunction(obj, context) {
.
.
.
//when below is triggered, SmartWizard gets stuck in infinite loop
if ('#addProfileCheckbox').prop('checked')){
$('#wizard').smartWizard('goToStep',4);
}
return true;
}
function onFinishCallback(){
console.log('here ...');
}
});
In Chrome i can see it causing the page to crash and "stack limit exceeded' error.