0
$('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 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

2

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.