activate/deactivate ui buttonset

by RobertSudwarts

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.20/themes/base/jquery-ui.css" type="text/css" media="all">
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all">

<div id="test">
<input type="radio" id="time1" name="radio" value="1" /><label for="time1">Test 1</label>
<input type="radio" id="time2" name="radio" value="2" /><label for="time2">Test 2</label>
<input type="radio" id="time3" name="radio" value="3" /><label for="time3">Test 3</label>
</div>

disable-enable <input type="checkbox" id="check" />

JavaScript

$('#test').buttonset();

$('#check').change(function() {
    if (this.checked) {
        $("#test input").button("disable");
    }
    else {
        $("#test input").button("enable");
    }
});