Jquery and Captcha on same page can't get it working
<p>I warn you now very little experience at jquery. My question is this. I have a username and password form. I have Jquery that accesses a php page looks into the database matches the password and user name then echos "yes" or no based off if the input is right then takes me to the next page. Now since this Jquery works on submit I can't figure out how to add a javascript captcha correctly to the page because it wont verify the word. So I'm wondering how to alter or add to this code so that I can first verify the word using javascript then the jquery below. Any help would be appreciated thanks.</p>

<pre><code>&lt;script language="javascript"&gt;
    $(document).ready(function()
    {
        $("#login_form").submit(function()
        {
            //remove all the class add the messagebox classes and start fading
            $("#msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000);
            //check the username exists or not from ajax
        $.post("ajax_login.php",{ user_name:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,function(data)
            {
              if(data=='yes') //if correct login detail
              {
                $("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
                { 
                  //add message and change the class of the box and start fading
                  $(this).html('Logging in.....').addClass('messageboxok').fadeTo(900,1,
                  function()
                  { 
                     //redirect to secure page
                     document.location='edujob.php';
                  });
                });
              }
              else 
              {
                $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
                { 
                  //add message and change the class of the box and start fading
                  $(this).html('incorrect').addClass('messageboxerror').fadeTo(900,1);
                });     
              }

            });
            return false; //not to post the  form physically
        });
        //now call the ajax also focus move from 

    });
    &lt;/script&gt;
</code></pre>
