简体   繁体   English

reCAPTCHA-隐藏提交按钮

[英]reCAPTCHA - hide the submit button

I'm setting up reCAPTCHA and trying as good as I can in regards to hiding the submit in the JavaScript triggered div. 我正在设置reCAPTCHA,并尽我所能将隐藏提交隐藏在JavaScript触发的div中。 Instead the submit button is always visible (it even is in Googles own example: http://www.google.com/recaptcha/demo/ajax ) 相反,提交按钮始终可见(甚至在Google自己的示例中: http : //www.google.com/recaptcha/demo/ajax

Any idea on how I can fix this? 关于如何解决此问题的任何想法吗? I've of course tried to put the button in the div and trying to modify the JavaScript snippet, but unfortunately with no luck. 我当然尝试将按钮放入div并尝试修改JavaScript代码段,但不幸的是没有运气。 Need this fixed since I don't want people to just press enter to submit. 需要修正此问题,因为我不希望人们仅按Enter键即可提交。

This is my code: 这是我的代码:

<form method="POST" action="verify.php">
<div id="captchadiv" style="display:none;">
<?php
require_once('recaptchalib.php');
$publickey = "<key>";
echo recaptcha_get_html($publickey);
?>
<input type="submit" name="Button1" value="OK">
</div>
<input type="hidden" name="vote" value="<?=$image_id;?>" readonly>
</form>
<span class="vote"><a onclick="showRecaptcha();" class="voteLink">test</a></span>

And this is the JS snippet: 这是JS片段:

function showRecaptcha(element) {
Recaptcha.create("<key>", 'captchadiv', {
theme: "red",
callback: Recaptcha.focus_response_field});
}

Been trying with the custom widget here: https://developers.google.com/recaptcha/docs/customization?hl=no#Custom_Theming But no luck. 在这里尝试使用自定义窗口小部件: https : //developers.google.com/recaptcha/docs/customization?hl= no#Custom_Theming但没有运气。

custom_theme_widget:

Any ideas, please? 有什么想法吗? Been trying to find my way through the API, but can't seem to solve this. 一直试图通过API找到我的方法,但是似乎无法解决此问题。

在Google示例中,您可以使用CSS隐藏“提交”按钮。

input[type=submit]{ display:none; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM