jQuery form validation function/plugin
<p>emailI am building a function to validate forms, which I can use for upcoming projects.
I am a little bit stuck at the moment, I need to find a way to add a background red if all the inputs of the form are empty. 
SO far:</p>

<p>$(document).ready(function() { </p>

<pre><code>$('label').click(function() {  

    var hasError = false,
        emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/,
        form = $('form'),
        radio_check = $('.tick .test'),
        input = $('input:not(.submit)'),
        emailaddressVal = $("#email").val(),
        email = $('#email');

            if(email.val() === ''){
                email.css('background-color', 'red');
            }

            else if(!emailReg.test(emailaddressVal)) {
                email.css('background-color', '#faa');
                hasError = true;
            }


            if(hasError == true) { return false; }

  });
});
</code></pre>

<p><a href="http://jsfiddle.net/kMZeW/" rel="nofollow">Full code</a></p>

<p>SO far it's only checking if the email input is empty and if there is a wrong email format.
However the first thing I would like to do is to check if there are any empty input fields and if yes assign them a css property.</p>
