I mean, if I check the input of the first clients, and this is normal, the second check of the same input is always false ... Why is this?
I really need to check it twice (one for client side verification and one for server side verification)
Thanks in advance!
EDIT
Clarification:
If user input is OK and recaptcha returns true (I do it via ajax on my server, which sends a request to the recaptcha server), the form sends and sends through POST also 2 variables: recaptcha_challenge_field value and recaptcha_response_field value (<which has already been checked), and my server asks the recaptcha server to check these two values ββagain for 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 a different result (it only alerts FAILED ).
captcha recaptcha
Vitali ponomar
source share