I mean if I check first clients input and it is OK the second check of the same input is always false... Why is that?
I really need ability to check it twice (one for client side validation and second for server side validation)
Thanks in advance!!!
EDIT
Clarifying:
If user's input is ok and recaptcha returns true (I do it through ajax to my server which sends request to recaptcha's server) the form is submitting and sends via POST also 2 variables: recaptcha_challenge_field
value and recaptcha_response_field
value (which was already checked) and than my server asks recaptcha's server to check again this two values to do server side validation.
Jquery code:
$("#form_id").find("button").click(function(){
var c = $("#recaptcha_challenge_field").val(),
r = $("#recaptcha_response_field").val();
$.ajax({
url: "/ajax/captcha?challenge=" + c + "&response=" + r,
dataType: "json",
success: function(data){
if(data['is_valid']){
$.ajax({
url: "/ajax/captcha?challenge=" + c + "&response=" + r,
dataType: "json",
success: function(data){
if(data['is_valid']){
alert('OK');
}else{
alert('FAILED');
}
}
});
}else{
Recaptcha.reload();
}
}
});
return false;
});
So, as you can see there are two absolutely identical operations with different result (it alerts only FAILED
).
One of the most common reasons why this error occurs is that of an outdated Chrome version. reCAPTCHA will actively look at the browser version before allowing you access. This is applicable to all browser versions, not just Chrome. In this case, the solution is to update Google Chrome to the latest version.
If you change your domain, update reCAPTCHA settings It can take up to 30 minutes for domain updates to take effect.
Note: reCAPTCHA tokens expire after two minutes. If you're protecting an action with reCAPTCHA, make sure to call execute when the user takes the action rather than on page load. You can execute reCAPTCHA on as many actions as you want on the same page.
Because it is stored in a session that is cleared when the result is submitted. On page load, a new session variable for that CAPTCHA value is generated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With