title: JS/AJAX: Hide/Show select boxes
body: <p>The function disables select boxes that do not match with the main category. I have one main category and two subcategories. Is there a way i can hide and show the subcategories select boxes instead of disabling them? </p>
  
  <p><strong>JS/AJAX</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var formObject = {
      run : function(obj) {
  
              obj.nextAll('.update').html('&lt;option value=""&gt;----&lt;/option&gt;').attr('disabled', true);
              var id = obj.attr('id');
              var v = obj.val();
              jQuery.getJSON('update.php', { id : id, value : v }, function(data) {
                  if (!data.error) {
                      obj.next('.update').html(data.list).removeAttr('disabled');
                  } else {
                      obj.nextAll('.update').html('&lt;option value=""&gt;----&lt;/option&gt;').attr('disabled', true);
                  }
              });
          }   
  }; 
  &lt;/script&gt;
  </code></pre>