I am trying to write a script which clears the value of all input fields except for one. This script is still clearing the DESCRIPTION input field.
jQuery('.campaign-column').not('active').each(function(index){
if(jQuery('.campaign-column input[name!="DESCRIPTION"]')){
jQuery(this+':input').val('');
}
});
Simplify:
$('.campaign-column:not(.active) input:not([name="DESCRIPTION"])').val('')
I assume you meant .not('.active')
and not .not('active')
, since there is no <active>
element in HTML. Note, the loop (.each()
) in your original code is pointless, since every iteration selects, over and over, the same elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With