Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter bootstrap wizard skip steps during onnext

This is a specific question to twitter bootstrap http://vadimg.com/twitter-bootstrap-wizard/

I am trying to work out if anyone has been able to skip steps when handling the onNext event. I want to skip steps depending on inputs that have been selected on previous steps. I have seen you can do this:

$('#rootwizard .finish').click(function() {
    alert('Finished!, Starting over!');
    $('#rootwizard').find("a[href*='tab1']").trigger('click');
});

I can't use this as I have disabled the tabs, and this unfortunately doesn't help if I use this during the onNext event if I have enabled the tabs as it continues to executes the code from the onNext event caller.

Thanks Dan

like image 669
Danjuro Avatar asked Nov 03 '22 06:11

Danjuro


1 Answers

simply you can use

_myWizard.bootstrapWizard('show', 6);// zero-bazed index

and _myWizard is what returned from bootstrapWizard initialisation

var _myWizard=$('#AddMemberWizard').bootstrapWizard({
    'tabClass': 'form-wizard',
    'onNext': function (tab, navigation, index) {
            .....
         }
});

hope this helps you

like image 122
Basheer AL-MOMANI Avatar answered Nov 07 '22 22:11

Basheer AL-MOMANI