VinceG / twitter-bootstrap-wizard

This twitter bootstrap plugin builds a wizard out of a formatter tabbable structure. It allows to build a wizard functionality using buttons to go through the different wizard steps and using events allows to hook into each step individually.
MIT License
1.39k stars 676 forks source link

Force specific tab #115

Closed neotropic2023 closed 9 years ago

neotropic2023 commented 9 years ago

Hey there, great plugin. Something I noticed and acting weird.

I have a form inside the wizard. People selecting options for a purchase (advertising). The last step and since I can not place a form within a form (obviously), I make the actual form you enter the details for CC on a dialog. My own reasoning why two forms. Storing data first before purchase in case something happens and all the info they entered is still there, saved.

What I am trying to achieve. On step 4 (index 4) it is just a simple loading icon ect.. and opens a dialog. When the dialog opens, and say something happens, they change their mind on something they hit cancel, dialog closes, goes back to step 3.

First time, works great. Second time. Goes back two steps. Third time goes back three steps. Kind of confusing when they have to click to get to the end to step four and the last index is 3. When they click to close the dialog, I run this '$(".previous a").click();'. Any way to tell it to just go to index 3? It is like it ignores storing anything after I click next upon closing the dialog. Yet moves forward when clicked. And the last index is always 3. How does it go back 2 or 3 steps once at the end on the 2nd and 3rd time?

Thanks.

VinceG commented 9 years ago

@neotropic2023 can you try

$('#rootwizard').bootstrapWizard('show',3);

??

neotropic2023 commented 9 years ago

Thanks! Will give it a shot. Project on hold at the moment.

neotropic2023 commented 9 years ago

Awesome, it works great. $('#rootwizard').bootstrapWizard('show',2); is what I needed. 0,1,2,3

karaspr commented 5 years ago

Awesome, it works great. $('#rootwizard').bootstrapWizard('show',2); is what I needed. 0,1,2,3

Where exactly did you put this code? Somewhere in \<a> section? I think I'm looking for the same thing as you