问题
I have the reCaptcha FormControl in my WebPart
<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>
I did a test that I filled all required field but leave the reCaptcha blank or unchecked, clicked Submit button and the form was submitted successfully.
Did I miss something?
回答1:
If it is your custom webpart, you need to call the IsValid()
method to check whether the text was correctly entered.
来源:https://stackoverflow.com/questions/30203959/kentico-recaptcha-does-not-block-form-submission