title: Showing/Hide Tabs and Section Based On Checkbox Value
body: <p>I am working on a form and want to <code>show/hide</code> tabs and their sections based on checkbox value. The code I have kind of works, but if you notice that when you check the three checkboxes, it unhides 3 tabs but it also shows all three sections displayed under the first tab. If you click on any of the tabs after un-hiding, it works fine. It's just that initial un-hiding that isn't working as I need it to. Here is what I have: <a href="http://jsfiddle.net/jcaine04/HyMBD/" rel="nofollow">http://jsfiddle.net/jcaine04/HyMBD/</a></p>
  
  <pre><code>$(document).ready(function(){
          /*
          **********************
          *   Initialization   *
          **********************
          */
  
          $("#contractTypes").tabs(); //create the tabs
          $(".datepicker").datepicker({ //date picker code
              changeMonth: true,
              changeYear: true
          });
  
          //if UA Checkbox not checked, hide the section
          if (!$("#OBKey_Use_Agreement_Required").is(':checked')){
              $(".UASection").hide();
          }
          //if Extranet Checkbox not checked, hide the section
          if (!$("#OBKey_Extranet_Access").is(':checked')){
              $(".extranetSection").hide();
          }
          //if MoveIt Checkbox not checked, hide the section
          if (!$("#OBKey_Move_It_Access").is(':checked')){
              $(".moveItSection").hide();
          }
  
  
          /*
          **********************
          * End Initialization *
          **********************
          */
  
          //hide/show UA Section
          $("#OBKey_Use_Agreement_Required").click(function() {
              if ($("#OBKey_Use_Agreement_Required").is(":checked"))
              {
                  $(".UASection").show("fast");
              } else {
                  //otherwise hide it
                  $(".UASection").hide("fast");
              }
  
          });
  
          //hide/show Extranet Section
          $("#OBKey_Extranet_Access").click(function() {
              if ($("#OBKey_Extranet_Access").is(":checked"))
              {
                  //show hidden class
                  //$(" #tabs ").tabs( "enable", 1 ); 
                  $(".extranetSection").show("fast");
                  //$("#tabs").tabs("select", "#UASection");
  
              } else {
                  //otherwise hide it
                  $(".extranetSection").hide("fast");
              }
  
          });
  
          //hide/show Move It Section
          $("#OBKey_Move_It_Access").click(function() {
              if ($("#OBKey_Move_It_Access").is(":checked"))
              {
                  //show hidden class
                  $(".moveItSection").show("fast");
                  //$("#tabs").tabs("select", "#UASection");
  
              } else {
                  //otherwise hide it
                  $(".moveItSection").hide("fast");
              }
  
          });
  
      });
  </code></pre>