javascriptjquerytwitter-bootstrapwizardtwitter-bootstrap-wizard

Disable multiple tabs at once


I am using Twitter bootstrap wizard plugin to make a step by step wizard. I have written functions on document ready to disable all the tabs except the first tab. This is how I have it:

$('#rootwizard').bootstrapWizard('disable', '1');
$('#rootwizard').bootstrapWizard('disable', '2');
$('#rootwizard').bootstrapWizard('disable', '3');

More details on how to disable can be found here

I don't prefer this ways because when I have like 10 tabs I have to write disable code for each of them. So is there a way to maybe pass all the tab indices in the parameters? So that I can get it done with just one line of code.


Solution

  • From the docs:

    Disables a tab, disallows a user to click it (adds .disabled to the li element)
    

    So, reasonably, you can just add class="disabled" to any of the tabs you want disabled on page load.

    As for passing them all via the function, the plugin does not support that.