Apply a jQuery function to a specific variable
<p>I would like to get the flip_error() applied only to these input fields which have an empty value. As it stands it gets applied to all of them:</p>

<pre><code>function flip_error(element){
    element.addClass('flipped');
}

function add_color(element, color){
    element.css('background-color', color);
}

    $('form input:not(.submit, .email, .test)').each(function(){
        if ($(this).val() == '') {
            flip_error(input.parent()); 
        }

        else {
            add_color($(this), white);
        }

    });
</code></pre>

<p>See full code <a href="http://jsfiddle.net/mM6Uh/3/" rel="nofollow">here</a></p>

<p>The issue is that when I click on submit for the first time and without entering any text in the input fields the flip to red (another input field) and it's fine so far. However If I fill one of the input fields in with text it still flips to red and that's wrong as it needs to get the add_color() function applied.</p>
