简体   繁体   中英

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. Instead the submit button is always visible (it even is in Googles own example: 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. Need this fixed since I don't want people to just press enter to submit.

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:

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.

custom_theme_widget:

Any ideas, please? Been trying to find my way through the API, but can't seem to solve this.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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