How can I make reCAPTCHA a required field?

前端 未结 7 1308
闹比i
闹比i 2020-12-01 05:34

I\'m using Google reCAPTCHA and have been able to add the CAPTCHA component to my page inside a form. But when I submit the form there\'s no validation taking place to check

7条回答
  •  孤街浪徒
    2020-12-01 06:02

    I found this to be a quick & easy way to do it. Add this to your headers:

    
    

    This only works in HTML5, and is (or should be) supported by these browsers: http://caniuse.com/#feat=form-validation

    (The JS console in Chrome shows this error message: "Invalid form control" only in Google Chrome , and I haven't been able to work around this. Hopefully someone else will improve this response.)

提交回复
热议问题