Demo of Controlgroup enable and disable methods in JQuery UI





enable


Disabled

Change the disabled option to see the effect.

HTML

<div class="my_controlgroup">
      <select>
        <option>PHP</option>
        <option>MySQL</option>
        <option>JavaScript</option>
        <option>JQuery</option>
        <option>HTML</option>
        <option>ASP</option>
        <option>PhotoShop</option>
      </select>
      <label for="radio1">Tutorial</label>
      <input type="radio" name="type" id="radio1">
      <label for="radio2">Demo</label>
      <input type="radio" name="type" id="radio2">
      <label for="help">Help</label>
      <input type="checkbox" name="help" id="help">
      <label for="spinner" class="ui-controlgroup-label"># of Pages</label>
      <input id="spinner" class="ui-spinner-input">
      <button id="download">Download</button>
    </div>

JQuery

<script>
$(document).ready(function() {
//////////////////////////
$( function() {
    $( ".my_controlgroup" ).controlgroup()
    $( ".my_controlgroup" ).controlgroup({
      "direction": "horizontal"
    });
  } );
////////////////
////////
$("input:radio[name=r1]").click(function() {
var sel = $(this).val();
if(sel=='disable'){
$( ".my_controlgroup" ).controlgroup( "disable");
$('#d1').html("\$( \".my_controlgroup\" ).controlgroup( " + sel +")");

}

if(sel=='enable'){
$( ".my_controlgroup" ).controlgroup( "enable");
$('#d1').html("\$( \".my_controlgroup\" ).controlgroup( " + sel +")");	
}
})
////////////////
//////////////////////////
$( function() {
    $( ".my_selection" ).controlgroup()
    $( ".my_selection" ).controlgroup({
      "direction": "horizontal"
    });
  } );
////////////////
})
</script>