title: jQuery - Find any input with a given class that has no value
body: <p>I have a (very) basic validation script. I basically want to check for any inputs with class .required to see if there values are a) blank or b) 0 and if so, return false on my form submit. This code does not seem to return false:</p>
  
  <pre><code>function myValidation(){
    if($(".required").val() == "" || $(".required").val() == 0){
    $(this).css({ backgroundColor:'orange' })  ;
    return false;
    }
  }
  </code></pre>
  
  <p>Appending this function to my onSubmit handler of my form is not returning any results. Any light shed on this matter will be appreciated. </p>
  
  <p>I am basically after a function that iterates through all the inputs with class .required, and if ANY have blank or 0 values, return false on my submit and change the background colour of all badly behaved inputs to orange.</p>