var requestUrl = '/check_capcha.php'; $('body').on('submit', 'form.me', function (e) { var postData = $("form.me").serialize(); console.log(postData); $.ajax({ type: "POST", data: postData, url: requestUrl, success:function(data){ console.log(data); } }); e.preventDefault(); }); How do i e.preventDefault(); insert in date check? page code check_capcha.php:
if (!$APPLICATION->CaptchaCheckCode($_POST["captcha_word"], $_POST["captcha_sid"])) { echo 0; } else{ echo 1; }
e.preventDefault();, but I need to use it only when the answer from the server is0- Oleksandr