我的 WebPart 中有 reCaptcha FormControl
<script src='https://www.google.com/recaptcha/api.js'></script>
......
<div class="form-group">
<label>Please type the word below. If required use the buttons to change or listen to the word.</label>
<cms:RecaptchaControl ID="reCaptchaVld" runat="server" data-theme="clean" data-callback="cpCallBack();" PrivateKey="xxxxxxxxx" PublicKey="xxxxxxxxx" data-recaptcha="" CssClass="g-recaptcha" />
</div>
我做了一个测试,填写了所有必填字段,但将 reCaptcha 保留为空白或未选中,单击“提交”按钮,表单已成功提交。
我错过了什么吗?
最佳答案
如果是您的自定义Web部件,您需要调用IsValid()
方法来检查文本输入是否正确。
关于javascript - Kentico reCaptcha 不会阻止表单提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30203959/