jquery POST method callback function query

Titeuf49

New Member
\[code\]$("#submit_js").click(function() { var commentmsg = $('#comment').val(); $.post( "user_submit.php", {comment: $("#comment").val(), aid: imgnum, uid:$("#uid").val()}, function(data){ /*alert(data);*/ //$('#greetings').html('Your choice was submitted successfully. Thank You for voting.'); $('#confirm_msg').addClass("on"); $('#care_parent').addClass("off"); $('#fb_user_msg').html(commentmsg); //$('#fb_user_msg').html( commentmsg ); }); });\[/code\]the above is my jquery POST function. in the callback function i am doing some html stuff. this is the successful POST version. that means, when the POST procedure is complete or added to the DB. now in my user_Submit.php i am checking to validate whether I should add the data to the DB or not. Can the callback function be modified so that if I dont add to the DB in user_Submit.php, I should display some other message to the user...what I really want to ask is, how to make PHP pass a 0/1 value ot JS? can someone help?
 
Back
Top