Reputation: 3752
I am trying to reset all the form fields except one.
$(':input','#myForm').not(':button, :submit, :reset, :hidden, input[ignoreField]').val('').removeAttr('checked').removeAttr('selected');
How can I exclude inputs with "ignoreField" class?
thanks in advance
Upvotes: 5
Views: 6279
Reputation: 4725
$(':input','#myForm').not('.ignoreField').val('').removeAttr('checked').removeAttr('selected');
Upvotes: 1
Reputation: 44740
You can use - input[class=ignoreField]
$(':input','#myForm').not(':button, :submit, :reset, :hidden, input[class=ignoreField]')
Upvotes: 3