相关疑难解决方法(0)

如何使用javascript/jQuery验证google reCAPTCHA v2?

我在aspx中有一个简单的联系表单.我想在提交表单之前验证reCaptcha(客户端).请帮忙.

示例代码:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Test Form</title>
        <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
        <script src="//code.jquery.com/jquery-1.10.2.js"></script>
        <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
        <link rel="stylesheet" href="/resources/demos/style.css">
        <script src="https://www.google.com/recaptcha/api.js" async defer></script>
        <script>
            $("#cmdSubmit").click(function () {
                //need to validate the captcha
            });
        </script> 
    </head>
    <body>
        <form id="form1" runat="server">
            <label class="clsLabe">First Name<sup>*</sup></label><br />
            <input type="text" id="txtFName" name="txtFName" class="clsInput" /><br />
            <div class="g-recaptcha" data-sitekey="my_key"></div>
            <img id="cmdSubmit" src="SubmitBtn.png" alt="Submit Form" style="cursor:pointer;" />
        </form>
    </body>
    </html>
Run Code Online (Sandbox Code Playgroud)

我想在cmdSubmit点击时验证验证码.

请帮忙.

javascript asp.net jquery google-api recaptcha

109
推荐指数
8
解决办法
26万
查看次数

谷歌ReCAPTCHA如何制作所需?

有谁知道如何让" Google ReCAPTCHA(v2) "成为"必需" form

我的意思是在重新填写之前没有表格提交?

我在我的形式中使用ParsleyJs,但没有找到一种方法使它与divs ...

html validation jquery recaptcha parsley.js

13
推荐指数
1
解决办法
2万
查看次数