tags:

views:

70

answers:

2
$('fieldset').not('#Pchk input[type=checkbox]').find("input,select,textarea").attr('disabled','disabled');

Pchk is the id of my input checkbox

and even i did this code to its not working out for me..

$('fieldset').not(':checkbox').find("input,select,textarea").attr('disabled','disabled');

if I use this code its disabling even my checkbox from fieldset? this code is right?

thanks

+2  A: 

You are applying the not filter to the fieldset, not to the inputs. Try:

$('fieldset').find('input:not(:checkbox),select,textarea').attr('disabled','disabled');
Luke Bennett
+2  A: 

You cannot use .not() as the second part of the chain because:

.not( selector ) Returns: jQuery

Description: Remove elements from the set of matched elements.

and you're trying to match fieldsets in the first order ;)

try:

$('fieldset').children("input,select,textarea").not('input[type=checkbox]').attr('disabled','disabled');

but I'm not 100% sure

veritas