javascript - How to disable the step navigation in bootstrap? - Stack Overflow

Below is the image of bootstrap step navigation,Now I have a 'next' button(not visible in thi

Below is the image of bootstrap step navigation,

Now I have a 'next' button(not visible in this picture) at the bottom of the page, on pressing the 'next' button I go from 'step-1 basic information' to 'step-2 restaurant categories'. But the problem is that when I click '2' or '3' in from the navigation I could go to the respected steps. I want to disable this feature because I only want the user to press 'next' button to go from one step to other. Can anyone help me on what to do to disable the navigation from the navigation bar? Thanks in advance.

Below is the image of bootstrap step navigation,

Now I have a 'next' button(not visible in this picture) at the bottom of the page, on pressing the 'next' button I go from 'step-1 basic information' to 'step-2 restaurant categories'. But the problem is that when I click '2' or '3' in from the navigation I could go to the respected steps. I want to disable this feature because I only want the user to press 'next' button to go from one step to other. Can anyone help me on what to do to disable the navigation from the navigation bar? Thanks in advance.

Share Improve this question asked Jan 16, 2014 at 8:15 SaumilSaumil 2,5176 gold badges34 silver badges54 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

Just got the solution,

Include the following script in the file,

  <script>
        $(document).ready(function() {
                  $('#rootwizard').bootstrapWizard({onTabClick: function(tab, navigation, index) {
                        alert('on tab click disabled');
                        return false;
                }});        
</script>

You can remove the alert().

When you create the step navigation you could just disable this part:

<li class="disabled">
   <a href="#">
      <span class="circle">5</i></span><br>
      <span class="label">Restaurant Categories</span>
   </a>
</li>

So the total step navigation would look sth like that:

<div class="row">
 <div class="col-md-12">
  <ul class="stepper stepper-horizontal">
    <li class="pleted">
      <a href="#">
        <span class="circle">1</span><br>
        <span class="label">Basic information</span>
      </a>
    </li>
    <li class="active">
      <a href="#">
        <span class="circle">2</span><br>
        <span class="label">Restaurant Categories</span>
      </a>
    </li>
    <li class="disabled">
      <a href="#">
        <span class="circle">3</i></span><br>
        <span class="label">Restaurant Timings</span>
      </a>
    </li>
  </ul>
 </div>
</div>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744904101a4600150.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信