php – 如何将Jquery Validate插件与recaptcha集成?

当你使用
Jquery Validate插件以快速方式验证整个表单时,它有点无聊,但是当它涉及recaptcha时,你必须在服务器上检查它.

我可以使用jquery validate插件来检查recaptcha并显示消息,就像通常对其他字段一样吗?

虽然,我不知道如何构建它,但可能会为recaptcha创建一个像需要的验证规则,它可以将值发布到页面并获得响应.

最佳答案 猜猜远程用于重新验证

检查它在here

也许你应该在验证中

 remote : 'someurl.php?someparams'

完成这样的代码

    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"
        },      

在你的远程网址上

<?php

echo "true";

//or 

echo "false";
点赞