Hello all,
Here is a tutorial that indicates how to combine jQuery Form Validation with reCAPTCHA. http://snipplr.com/view/15563/jquery-validating-recaptcha-with-ajax/
Based on my understanding, the above tutorial in fact does a client side validation through aJax that communicates with the server reCAPTCHA script.
After the validation is successful, I use the following code borrowed from the comments:
$('#formID').validate({
submitHandler: function(form) {
if(validateCaptcha()){ // Submit form
offerForm.ajaxSubmit(); } } });
to submit the form and please see line 21 of the original code:
$("form").attr("action", "http://action/to/the/form_handler.php");
My question is whether or not I MUST call recaptcha_check_answer inside form_handler.php with passed in parameters
challengeField = $("input#recaptcha_challenge_field").val();
responseField = $("input#recaptcha_response_field").val();
If not, then a person can easily avoid the reCAPTCHA by changing the validation procedure. It seems that the same idea that we always have to both client+server validation.
Please correct my idea if I misunderstand.
// Give detail information for the issue I have ///
<code>
<form id="regFormBody" method="post" action="verify.php">
...
</code>
$("#regFormBody").validate({
debug: true,
errorPlacement: function (error, element) {
error.insertAfter(element.parents('div.collection:first'));
},
rules: {
loginemail: { required: true, email: true, rangelength: [4, 32] },
password: { required: true, rangelength: [8, 30], passwordPattern: true },
confirmpassword: { required: true, rangelength: [8, 30], equalTo: "#password" }
}
}
});
Here is the problem I have: If the form passes the client side validation, then it doesn't NOT trigger the verify.php at all and stops after the validation. thank you