在我的 recaptcha google 为什么提交不起作用? [英] in my recaptcha google why submit don't work?
本文介绍了在我的 recaptcha google 为什么提交不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了 google recaptcha 中的此代码,但提交无效(在 google captcha 之后什么也没发生),表单未提交,可能是因为我为 salesforce 添加了自己的操作?
I have used this code from google recaptcha, but the submit didn't work (after google captcha nothing happen), the form is not submitted, maybe because i have added my own action for the salesforce ?
<html>
<head>
<script>
var onSubmit = function(token) {
console.log('success!');
};
var onloadCallback = function() {
grecaptcha.render('submit', {
'sitekey' : 'your_site_key',
'callback' : onSubmit
});
};
</script>
</head>
<body>
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" thod="POST">
<input id='submit' type="submit" value="Submit">
</form>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
async defer>
</script>
</body>
</html>
我也使用过 google recaptcha v3,
i have also used google recaptcha v3,
我的表单已提交,但在服务器端我收到一个空数组.
my form is submitted but in server side i receive an empty array.
推荐答案
为了解决我的问题,我已将其升级到 reCaptcha v3,它更容易集成到我的 html 代码中.谢谢大家!
To resolve my issue, i have upgrade it to the reCaptcha v3, it was a lot easier to integrate to my html code. Thanks everyone!
这篇关于在我的 recaptcha google 为什么提交不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文