Q:ReCaptcha 2.0: enable Submit button on callback if recaptcha successful |
Q:验证码2:使如果reCAPTCHA成功提交按钮的回调函数 |
I have a very simple form as follows. I want to make it so that the Submit button is disabled, and only enabled after the user has successfully completed the ReCaptcha. I'm assuming I'm going to need some Javascript / jQuery to do this. Google's documentation on ReCaptcha 2.0 seems really sparse and dense (to me, anyway). I'd appreciate some pointers:
|
我有一个非常简单的形式如下。我想让提交按钮被禁用,只有启用在用户已经成功地完成了验证码。 我想我需要一些JavaScript、jQuery做这个。 谷歌文档验证码2似乎真的疏与密(对我来说,无论如何)。我会欣赏一些指针:
|
answer1: | 回答1: |
i did the same thing on my test site. however, i used a button instead of submit, so here: you must add the property data-callback="enableBtn" data-callback property executes the function specified after accomplishment of recaptcha.
and set the id of the button to whatever id you want to:
On Page load/form load of disable the button
then on javascript make a function to enable the button
hope it helps. |
我在我的测试网站做同样的事情。不过,我用了按钮而不是提交,所以在这里: 你必须添加属性数据回调=“enablebtn”楼市回调函数中指定的数据执行完成后的验证码。
并设置按钮的ID到你想要的任何ID:
在页面加载/窗体加载禁用按钮
然后对JavaScript做功能使按钮
希望它帮助。 |
javascript php jquery captcha recaptcha |