On 14 Feb, 15:57, freech <[EMAIL PROTECTED]> wrote:
>       //I have problem on here:
>       if ( !$(".sdComt").response )  { return false; }  else { return
> true; }

ok, if I got it right, you're using a $.post call to check if the
user's input is correct or somehow acceptable, and then you append to
the form an hidden input to be checked on submit.
ok, assuming that check.php returns the string 'true' or 'false', one
way of doing that is adding a listener for the submit action of your
form.

$('#sdComt').submit(function(){
     //code here
});

inside this event handler you will put your ajax call.

$('#sdComt').submit(function(){
     $.post('check.php', {.....
});

in order to decide whether the form is to be passed or not, you will
have to wait for the response.
so all the actions that rely on those data, have to be put in the
callback function of $.post

$('#sdComt').submit(function(){
     $.post('check.php',
       {username: $('#username').val(),password: $
('#password').val()},
       function(data){
             if (data == 'true') return true;
                    else return false;
       });
});

hope this helps... but I'm not sure I got the flow right :)

Reply via email to