How to integrate Jquery Validate plugin with recaptcha?

Its kind of bored, when you check the whole form using the Jquery Validate plugin, but when it comes to recaptcha, you have to check it on the server.

Can I use the jquery validation plugin to validate recaptcha and display messages, as is usually done for other fields?

Although I do not know how to build it, a validation rule can be created, for example, required for recaptcha, which can send a value to the page and receive a response.

+4
source share
2 answers

Guess remote used to check recaptcha

check it out here

perhaps you should have in your check

  remote : 'someurl.php?someparams' 

Complete the code with something like this

  rules:{ username: {required: true}, password: {required: true}, email: {required: true, email: true}, recaptcha: {required: true, remote: "someurl.php"}, fullname: {required: true}}, messages: { username: "Category name is required", password: "Password is required", fullname: "Full Name is required", recaptcha: {required: "captcha is required", remote: "Invalid captcha"}, email: "Valid email is required" }, 

At remote URL

 <?php echo "true"; //or echo "false"; 
+2
source

No. The reCAPTCHA confirmation is done by Google servers and involves sending the private key (i.e., Something that should never be placed in a public location such as JavaScript).

0
source

Source: https://habr.com/ru/post/1347506/


All Articles