Open spyalert01 opened 10 years ago
I think this is similar to issue 56, because a good solution to both would be to have a public method for setting any of the available property values after initialization of the wizard.
Hi, I am not sure it is the same or not. I am having difficulty... for example at the FINAL Step, instead of user click FINISH, they click Previous, then they may change something during the Previous / Previous few step, and click FINISH directly.
When I want to do is when they click PREVIOUS at the FINISH stage, I want to disable to finish, until when the process reaches the Finish again.
Would this work?
$('#wizard').smartWizard({ onShowStep:showAStepCallback, onFinish:onFinishCallback }); function showAStepCallback(obj) { var currentStep = obj.attr('rel'); if (currentStep < '5') { // last step number $('.buttonFinish').addClass('buttonDisabled'); } } function onFinishCallback(objs, context){ $('form').submit(); }
prov, your proposed code might work, however to me it's a workaround, absent a native solution. To me the ultimate clean solution is to have a smartwizard public method to modify a wizard property. For example in this case the OP would want to toggle or set enableFinishButton.
Spyalert, I do feel this solution would address this issue and 56, because the ability to modify properties would enable the desired behavior in both issues, and also many others.
Hi Thanks for your reply. I have tried what you have suggested earlier. It will disable... then will be re-enable after the previous page loaded.
I think there must be some flag which control this.
On Thu, Apr 24, 2014 at 1:26 PM, Randy H notifications@github.com wrote:
Would this work?
$('#wizard').smartWizard({ onShowStep:showAStepCallback, onFinish:onFinishCallback }); function showAStepCallback(obj) { var currentStep = obj.attr('rel'); if (currentStep < '5') { // last step number $('.buttonFinish').addClass('buttonDisabled'); } } function onFinishCallback(objs, context){ $('form').submit(); }
— Reply to this email directly or view it on GitHubhttps://github.com/mstratman/jQuery-Smart-Wizard/issues/58#issuecomment-41243921 .
Hi Randy, Thanks. Its working now. exactly the way you mention :)
On Thu, Apr 24, 2014 at 1:26 PM, Randy H notifications@github.com wrote:
Would this work?
$('#wizard').smartWizard({ onShowStep:showAStepCallback, onFinish:onFinishCallback }); function showAStepCallback(obj) { var currentStep = obj.attr('rel'); if (currentStep < '5') { // last step number $('.buttonFinish').addClass('buttonDisabled'); } } function onFinishCallback(objs, context){ $('form').submit(); }
— Reply to this email directly or view it on GitHubhttps://github.com/mstratman/jQuery-Smart-Wizard/issues/58#issuecomment-41243921 .
When the user reached the final step. The wizard has 2 options: 1) Previous, and 2) Finish.
If the user decided to click Previous. how can I disable the Finish button.
And I am expecting the finish button to be enabled again, the next time they click NEXT and reach the final step.
Hope to hear from you.
thanks