You can use something like:
$('input,select,textarea').not('table input').not('table select').attr('disabled',true);
Or shorter:
$('input,select,textarea').not('table input,table select').attr('disabled',true);
But you can also add a class to all inputs that need to be disabled, and just use:
$('.toBeDisabled').attr('disabled',true);
Or some of them will not be disabled:
$('input,select,textarea').not('.notToBeDisabled').attr('disabled',true);
Or if you want to include all form elements (also buttons), use:
$(':input').not('table :input').attr('disabled',true);
source share