Combining jQuery validate and jQuery Real Person

醉酒当歌 提交于 2020-01-06 20:23:48

问题


I'm using jQuery validation to make sure all my required fields are filled in, however I was getting a lot of bot spam and want to use something like jQuery Real Person as a captcha system .

How do I combine the 2, so that t=submit will fail if the captcha field is not correct?

$("#enroll").validate({

                invalidHandler: function(e, validator) {
                    var errors = validator.numberOfInvalids();
                    if (errors) {
                        var message = errors == 1
                            ? 'You missed 1 required field.'
                            : 'You missed ' + errors + ' required fields';
                        $("div.Error span").html(message);
                        $("div.Error").show();
                    } else {
                        $("div.Error").hide();
                    }
                },
            });

The link, if relevant is here

来源:https://stackoverflow.com/questions/16326223/combining-jquery-validate-and-jquery-real-person

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!