jQuery live validation
<p>I'm trying to create a live validation script for a form. I've somewhat got it, I think anyway...but the error message comes up when there is text in the field as opposed to when there is no text. I'm sure I'm doing something stupid wrong, I'm pretty sure I have the if values right, <code>value == ''</code> is if value is nothing, <code>value !== ''</code> is if value is not nothing, right? Gah, maybe it's the on/change thing I should change? Hope you can help. Thank you.</p>

<p><a href="http://jsfiddle.net/Vjwxs/3/" rel="nofollow">http://jsfiddle.net/Vjwxs/3/</a></p>

<pre><code>$(document).ready(function () {    
    $('#name').on('change', function() {
        var name = $("#name").val();
        if (!this.value == '') {
            $("#errorname").fadeIn();
            $('#errorname').css("display", "inline-block");
            $('#errorname').css("color", "#838383");
            $('#errorname').css("background-color", "#fff568");
        }
        else if (!this.value !== '' ) {
            $("#errorname").fadeOut();
            $('#errorname').css("display", "none");
        }
    });
}); 
</code></pre>
