[英]How to integrate the Jquery Validate Plugin with recaptcha?
Its kind of a boring, when you validate the entire form using Jquery Validate plugin in a quick way, but when it is about the recaptcha, you have to check it on the server. 当您快速使用Jquery Validate插件验证整个表单时,这有点无聊,但是当涉及到Recaptcha时,则必须在服务器上进行检查。
Can i use jquery validate plugin to check the recaptcha and show the messages, like it usually does for other fields? 我可以使用jquery validate插件来检查Recaptcha并显示消息吗,就像平常对其他字段所做的那样?
Although, I dont know how to build it, may be a validate rule like required
can be created for recaptcha, which can post the value to a page and get the response. 虽然,我不知道如何构建它,但是可能会为Recaptcha创建一个像
required
的验证规则,该规则可以将值发布到页面上并获取响应。
Guess remote
is used for recaptcha validate 猜
remote
用于重新验证
perhaps you should have in your validation 也许您应该在验证中
remote : 'someurl.php?someparams'
Complete code 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"
},
On your remote url 在您的远程URL上
<?php
echo "true";
//or
echo "false";
否。reCAPTCHA验证是在Google的服务器上完成的,并且涉及发送私钥(即,切勿将其放置在JavaScript等可公开访问的位置)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.