-
AuthorPosts
-
November 2, 2018 at 11:49 pm #1029380
I have a question. I would like to include Google Captcha in the Enfold contact form. Is that possible? If yes how?
November 6, 2018 at 4:40 pm #1030436Hey frasche,
Here are some threads to consider:
https://kriesi.at/support/topic/google-recaptcha-and-enfold-contact-form/#post-830898
https://kriesi.at/support/topic/google-recaptcha-and-enfold-contact-form/page/2/If you need further assistance please let us know.
Best regards,
VictoriaNovember 7, 2018 at 12:24 am #1030654Sorry, i read and read and read. But I don’t understand, what I have to do. Can you give me a simple answer, what I have to do?
I would like to say, that I have now some question to your support. But the Kriesi support is really not good. I already bought 9 licenses from Enfold and I expect a support that also helps and does not just refer to other posts.November 12, 2018 at 2:58 am #1032392Hi,
I would like to apologize for that. Please create a reCAPTCHA key here:
// https://www.google.com/recaptcha/admin
And then add this code in the functions.php file.
You have to add the reCAPTCHA public key on this line:
var publickey = 'YOUR PUBLIC API KEY';
Best regards,
IsmaelNovember 12, 2018 at 3:52 am #1032399Hello Ismael,
I tried exactly this way. But it did not work. I use Enfold 4.5 What am I doing wrong? I change YOUR PUBLIC API KEY with my Google Captcha Public key, but what i have to do with my secret key?
Is the code to be put in a special place in the file “functions.php”?
Do I have to install a special plugin also?Thanks for your help
FrankNovember 13, 2018 at 1:53 am #1032828Hi,
My bad. This is the updated reCAPTCHA snippet using the secret key.
Add the public key on this line:
var captcha = jQuery(" <p data-sitekey='PUBLIC KEY HERE' data-callback='onloadCallback' id='reCAPTCHAV2'></p> ");
And the secret key here:
$secret = 'SECRET KEY HERE';
You can create your own options panel and save the keys in your database if you don’t want to put them directly in the snippet.
Best regards,
IsmaelNovember 13, 2018 at 12:12 pm #1032958Hi Ismael,
Now it almost works. The problem now is that when the captcha is clicked, the page jumps back to the beginning.
Can you still solve this? Then it would be perfect.I sent you the link from the page in “Private Content” so you can see and test the problem.November 15, 2018 at 8:43 am #1033830Hi,
Glad it’s working. To fix the “jump” issue, look for this line:
window.location.hash = grecaptcha.getResponse();
Below, add this code:
if( history.pushState ) { history.pushState(null, null, window.location.hash); } else { location.hash = window.location.hash; }
Best regards,
IsmaelNovember 15, 2018 at 1:11 pm #1033925Hi Ismael,
i put your new code snipet now in my functions.phpvar onSuccessfullCallback = function(success) {
window.location.hash = grecaptcha.getResponse();
if( history.pushState ) {
history.pushState(null, null, window.location.hash);
}
else {
location.hash = window.location.hash;
}But it’s still the same problem (when the captcha is clicked, the page jumps back to the beginning)
I think, i put the code correct. What’s going wrong now?Regards Frank
November 15, 2018 at 1:12 pm #1033927createCaptcha(); var onloadCallback = function() { grecaptcha.render('reCAPTCHAV2', { 'sitekey' : publickey, 'callback' : 'onSuccessfullCallback' }); }; var onSuccessfullCallback = function(success) { window.location.hash = grecaptcha.getResponse(); if( history.pushState ) { history.pushState(null, null, window.location.hash); } else { location.hash = window.location.hash; }
November 16, 2018 at 7:35 am #1034310Hi,
Thanks for the update.
The reCAPTCHAv2 has been deprecated. You have to use v3 now and generate a new key.
// https://www.google.com/recaptcha/
This is the updated code: https://pastebin.com/qrWqXP59
The new script will no longer force the document to jump back on top. Again, you have replace the placeholders with your public and secret key.
Doc: https://developers.google.com/recaptcha/docs/v3
Best regards,
IsmaelNovember 16, 2018 at 8:24 am #1034324Hello Ismael,
I have now generated my public and secret key in Captcha V3. The new code you gave me (in my private content is a link to the website) does not work either.
The code does not show a captcha symbol. Do you see that in this picture?
This is not the newest Version of Enfold. Enfold 4.5 see picture at the next post.I have entered the public key V3 in the line var key = ‘XXX’ and also in the line under the function avia_register_reCAPTCHAV2_scripts (). Then I entered the V2 key in this line, but unfortunately that does not work either.
Here comes the code:
EDITED: Please use the plugin instead: https://github.com/KriesiMedia/enfold-library/tree/master/integration%20plugins/Enfold/Enfold%20G%20Recaptcha/enfold-recaptchaWhat do I wrong? Normally it’s easy with your description but it still not work.
Frank
- This reply was modified 6 years, 1 month ago by frasche.
November 16, 2018 at 10:23 am #1034347In Enfold 4.5 comes the Captcha on the right side.
- This reply was modified 6 years, 1 month ago by frasche.
November 16, 2018 at 12:38 pm #1034423Hey!
Thanks for the update.
Can you give us access to the dashboard and your file server? I would like to test the new scripts. Please provide the WP and FTP details in the private field.
Best regards,
IsmaelNovember 16, 2018 at 1:31 pm #1034445Hi Ismael,
the datas are in the Private ContentNovember 20, 2018 at 7:18 am #1035435Hi,
I would like to apologize for the delay. I managed to display the reCAPTCHA widget but there’s an error. Do you have the old v2 key? Please post it in the private field.
I disabled the modification temporarily.
Best regards,
IsmaelNovember 20, 2018 at 7:28 am #1035447Yes, here comes the keys:
November 20, 2018 at 8:36 am #1035472Hi,
Thanks for the info. It’s working now. (see private field for the final modification)
Best regards,
IsmaelNovember 20, 2018 at 9:58 am #1035483Fantastic! But how can I do that for my next project?
I have to modifiy the functions.php in ENFOLD same as your version? And than i have to create a function.php in ENFOLD-CHILD same as your version? Thats it?November 20, 2018 at 11:28 pm #1035823I’ve got the same problem, changed all in the child functions.php but something is missing. What do you mean with changings in the main functions.php (not the cild one) ?
Regards
robertNovember 21, 2018 at 10:52 am #1035963Hi,
You can copy that code on the child theme’s functions.php file for your next project. Just replace the site and secret key with your own. You have to use reCAPTCHA v2 instead of v3.
@robmarek: Did you change the keys on these lines?Site key: (line 06)
var key = 'SITE KEY HERE';
Site key: (line 101)
$key = 'SITE KEY HERE';
Secret: (line 76)
$secret = 'SECRET KEY HERE';
Best regards,
IsmaelNovember 22, 2018 at 3:13 am #1036369Hi Ismael,
I would like to say that you are the Number 1 of KRIESI support. You really help and it’s a pleasure to ask you something. Because you do everything, to found a solution for the Customer Problem.
I hope that next time you’re the one who takes care of my problem. Because some of your colleagues do not take support as seriously as you do.
Many Thanks
FrankNovember 22, 2018 at 11:46 am #1036461 -
AuthorPosts
- The topic ‘How can I put in the Google Captcha in the Enfold contact form’ is closed to new replies.