jquery - struggle with javascript variables
<p>I am having a bit of difficulty with a Jquery function. As I am very unsure of the language, I wonder if anyone can help.</p>

<pre><code>$('.editableWC').editable('&lt;?php echo base_url();?&gt;ratesheet/editrowwendCall/&lt;?=$editable['url'];?&gt;/', 
        {
        callback: function(value){
            $(this).data('bgcolor', $(this).css('background-color'));
            if(value == this.revert)
                {                                                                            
                $(this).animate({ backgroundColor: "red", color: "white" }, 400);
                $(this).animate({ backgroundColor: $(this).data('bgcolor'), color: "black" }, 400);
                }
            else
                {                                                                               
                $(this).animate({ backgroundColor: "green", color: "white" }, 400);
                $(this).animate({ backgroundColor: $(this).data('bgcolor'), color: "black" }, 400);
                }
             }, 
         name : 'value',
         style : 'display:inline; position:relative; right:120px;',
         width : '100px',
         height: '16px',
         onblur : 'submit' 
     });
</code></pre>

<p>This is my code. It simply checks the posted item in php validation and gets posted back the original value if does not meet the validation, or the new value if it does.</p>

<p>So, the code is supposed to see if the returned value is the same as the original and if no change, show red for unsuccessful, or green for successful (if value is different). The green does work, however It does not recognised the original value post back to be the same as the this.revert value. </p>

<p>What happens with this code is if value is unchanged = green
if value is change and meets validation = green
if value is changed, does not meet validation =  no animation at all. when it wants to flash red.</p>

<p>I'd appreciate any help as I am quite out of my depth when it comes to javascript.</p>
