Jquery Issue with validation
<p>I have question below
I have profile page contains user_name ,email,city etc...
when performing validation i will check user_name already existing or not and other regular stuff like emmail validation,integer check etc...
My problem is user_name check is a ajax call so beofre completing the user_name check validation is completed and inserted wrong user name that already existed..how can i prevent this.</p>

<p>my code is below</p>

<pre><code>function doValidation()
{   
var err = '0' ;
var errWebuser='0';
if($('#FHE_0_user_name').val()!="")
    {
    alert("call check");
    errWebuser=checkWebUserName('FHE_0_user_name');
    alert(errWebuser);
    }
$('.required input').each(function(){
    if(  ($(this).val() == '')  )
    {
        var id = $(this).attr('id');
        err = '1';
        $(this).css('border','1px solid #F00');
        appendError(id,'required');

    }
</code></pre>

<p>in that checkWebUserName is the ajax call</p>

<p>thanks alex</p>
