tags:

views:

51

answers:

2
$('#btnCancel').click(function() {

         $('fieldset:not(:checked)').find("input,select,textarea").removeAttr('disabled');
        });

how to enable only checked boxes? on the fieldsset? but when I do this code its enabling all my fields in the fieldset I need to enable only the fields which checkbox is enabled?

thanks

+1  A: 

You are searching for fieldsets that are not checked using the code you've posted. You'll want to apply the "not checked" logic to the input, select and textarea tags instead.

Daniel Egeberg
what should I use there?
+2  A: 

You can try something like this:

$('fieldset').find('input:not(:checked),select,textarea').removeAttr('disabled');
g.d.d.c
buts its doing only for that input box not for all select and textarea ?
Select and Textarea elements shouldn't have a 'checked' attribute. You could try `$('fieldset').find('input,select,textarea').filter(':not(:checked)').removeAttr('disabled');` I suppose, but those other elements shouldn't have a checked attribute to begin with.
g.d.d.c