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
).