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

Cannot disable Finish button for steps other than final step #68

Open StateBarofArizona opened 9 years ago

StateBarofArizona commented 9 years ago

If a user steps through all steps, the Finish button appears. If they go back to another step and make changes prior to Finish I want them to go back to my final step, a confirmation screen, before they can Finish. I've tried various options to disable the Finish button on all but the final step but nothing so far works.

sandipwane commented 8 years ago

Hey I am facing same problem. Did you find any solution over this

danonunez commented 8 years ago

Hi, i solved the problem as follows:

jquery.smartWizard.js line 387

Change:

if (this.options.includeFinishButton){ if (!this.steps.hasClass('disabled') || this.options.enableFinishButton){ $(this.buttons.finish).removeClass("buttonDisabled"); if (this.options.hideButtonsOnDisabled) { $(this.buttons.finish).show(); } }else{ $(this.buttons.finish).addClass("buttonDisabled"); if (this.options.hideButtonsOnDisabled) { $(this.buttons.finish).hide(); } } }

For:

if (this.options.includeFinishButton){ if(!this.options.enableFinishButton && (this.steps.length-1) !== this.curStepIdx) { $(this.buttons.finish).addClass("buttonDisabled"); if (this.options.hideButtonsOnDisabled) { $(this.buttons.finish).hide(); } } else { if (!this.steps.hasClass('disabled') || this.options.enableFinishButton){ $(this.buttons.finish).removeClass("buttonDisabled"); if (this.options.hideButtonsOnDisabled) { $(this.buttons.finish).show(); } }else{ $(this.buttons.finish).addClass("buttonDisabled"); if (this.options.hideButtonsOnDisabled) { $(this.buttons.finish).hide(); } } } }

Regards!

rahadi23 commented 7 years ago

thank you @danoespinoza