title: How to set the tab as disabled/enabled
body: <p>I have got a task to disable and enable tabs on the click of the checkbox.But in my first tab I have two filds name and age. The second tab is enabled only after the completion of the validation of first tab.I can show the tab by selecting the check box but it should not enabled.How can I do this?
  My Html code is</p>
  
  <pre><code> &lt;div id="tabs"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#tabs-0"&gt;Tab1&lt;/a&gt; 
              &lt;/li&gt;
              &lt;li&gt;&lt;a href="#tabs-1"&gt;Tab2&lt;/a&gt;
  
              &lt;/li&gt;
              &lt;li&gt;&lt;a href="#tabs-2"&gt;Tab3&lt;/a&gt;
  
              &lt;/li&gt;
              &lt;li&gt;&lt;a href="#tabs-3"&gt;Tab4&lt;/a&gt;
  
              &lt;/li&gt;
          &lt;/ul&gt;
          &lt;div id="tabs-0"&gt; &lt;b&gt;Name&lt;/b&gt;
  
              &lt;input type="text" id="name" /&gt;
              &lt;br/&gt; &lt;b&gt;Age&lt;/b&gt;
              &lt;input type="text" id="age" /&gt;
              &lt;br/&gt;
      &lt;input type="checkbox" name="tabs-0" value="0" checked&gt;tabs-1
      &lt;input type="checkbox" name="tabs-1" value="1" disabled&gt;tabs-2
      &lt;input type="checkbox" name="tabs-2" value="2" disabled&gt;tabs-3
      &lt;input type="checkbox" name="tabs-3" value="3" disabled&gt;tabs-4
  
              &lt;input type="submit" value="next" class="submit" /&gt;
          &lt;/div&gt;
          &lt;div id="tabs-1"&gt; &lt;b&gt;city&lt;/b&gt;
  
              &lt;input type="text" id="name" /&gt;
              &lt;br/&gt; &lt;b&gt;state&lt;/b&gt;
  
              &lt;input type="text" id="age" /&gt;
              &lt;br/&gt;
              &lt;input type="submit" value="next" class="submit" /&gt;
          &lt;/div&gt;
          &lt;div id="tabs-2"&gt;
              &lt;p&gt;Tab3&lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="tabs-3"&gt;
              &lt;p&gt;Tab4&lt;/p&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>$(function () {
      $("#tabs").tabs();
      $("#tabs").tabs("option", {
          "selected": 0,
              "disabled": [1, 2, 3]
      });
  
      $('.submit').click(function () {
          if($('#name').val()=='')
          {
              alert("empty");
          }
          else
          {
          var nexttab = parseInt($(this).parent().next().attr('id').match(/\d+/g), 10);
          $('#tabs').tabs("enable", nexttab).tabs("select", nexttab);
          $('input[name="tabs-'+nexttab+'"]').removeAttr('disabled').prop('checked', true);
          }
      });
  
  
      $("input[type=checkbox]").click(function () {
          if ($(this).is(':checked')) {
              $('#tabs').tabs("enable", $(this).val());
              $('#tabs').tabs("select", $(this).val()-1);
          } else {
              $('#tabs').tabs("disable", $(this).val());
              var tab = $(this);
              $(":checked").each(function (index) {
                  $('#tabs').tabs("select", $(this).val());
              });
          }
      });
  });
  </code></pre>
  
  <p>You can see the <a href="http://jsfiddle.net/2aQ2g/63/" rel="nofollow">DEMO</a></p>