$(function () {
function f1() {
if (this.checked) {
$('select[name=two]').removeAttr('disabled');
} else {
$('select[name=two]').attr('disabled', true);
}
}
$('input[name=one]').change(f1).triggerHandler('change');
$('.reset').click(function () {
$('input[name=one]').removeAttr('checked').end().click(f1);
})
});
... almost works. Please check fiddle here.
But the problem is:
- Check 'one' and select 'two' from dropdown.
- Click 'reset'.
- Check 'one' again and try selecting 'two' from dropdown.
Dropdown gets disabled automatically!
Many thanks for your help!