-
AuthorPosts
-
July 14, 2019 at 5:07 am #1118434
I have a contact form on my site that looks just fine except that the submit button doesn’t do anything when I press it. There is no form validation and no email sent. But even if I leave all required fields blank, they are not highlighted. This is a new problem for me on version 4.5.7. I have a site on 4.4.1 whose contat form works just fine.
I did try deleting and recreating the form, but it acts the same way.
Any ideas?
July 14, 2019 at 8:31 pm #1118539Hey osaez,
Can you disable caching and minification for now?
Best regards,
VictoriaJuly 14, 2019 at 8:43 pm #1118545I turned off CSS and JS merging and compression (what I think you meant by minification) and no change.
I had this problem before I had any caching, as well, but I turned that off, again, and no change.
Any other ideas? This is really odd… simply nothing happens!
Thanks!
July 14, 2019 at 8:47 pm #1118546OK… I found something… I turned OFF reCAPTCHA and now it works. So… how do I debug why that’s not working? I have an account, set up my keys and such but it seems to not be working. Is there anything on the server that could help em determine what’s wrong?
To be clear, I see no sessions on my ReCAPTCHA account on Google. So it seems nothing is getting there.
Thanks!
- This reply was modified 5 years, 4 months ago by osaez.
July 14, 2019 at 9:55 pm #1118583OK… this is getting stranger. If I turn off caching and minification, when I go to the site for the first time in a new browser window, the reCAPTCHA shows up. But even without typing anything, if I refresh the page, the reCAPTCHA disappears and the Submit button is back and non-functional. Only closing that window and reopening it will bring the reCAPTCHA back.
July 15, 2019 at 4:20 am #1118661Hi,
Did you set jQuery to load in the footer? We can see a few jQuery errors in the console, which seems to be related to another plugin. Is “ct_fkp_” familiar to you?
Best regards,
IsmaelJuly 15, 2019 at 3:38 pm #1118808Hey,
I have a similar problem. I have a contact form in the footer. With Google Recaptcha enabled it doesn’t do anything after clicking the submit button.
I traced the error a bit and came to the following insights:
– no JavaScript errors in the console
– the required JavaScript for Recaptcha isn’t placed in the DOM
– if another contact form is placed in the main content of a page the footer contact form also works, because the main content contact form placed the required JavaScript
– in theclass-grecaptcha.php
file line 271/272 the regex$regex = "!\[av_contact!"; preg_match( $regex, $post->post_content, $matches );
evaluates to falseI haven’t looked any further into the problem as to why this is, but I hope this helps in any way to fix the issue for me and others.
Regards,
DanielJuly 16, 2019 at 4:29 am #1119025Yes, it is a bit fickle. It seems to be working well for me, today. But it’s 100% broken using Microsoft Edge (which is a minor issue, but I test with lots of browsers). I think I’m going to let this be for a while as I have more pressing issues, but I’ll keep my eye on it.
To the previous question from Ismael, no “ct_fkp_” is not familiar to me (but not much of this is as I inherited it from the previous administrators). My main tasks have been to upgrade the server, WP and Enfold to get things “modern.” There are just a few lingering issues, like this.
Thanks!
July 17, 2019 at 8:07 am #1119441Hi,
@xoidberg: Thanks for the info. You can actually remove that code because what it does is prevent the recapcha script from loading when there is no contact form element in the page. Try to replace the whole is_recaptcha_active function with the following code.
public function is_recaptcha_active() { global $post; if( ! $post instanceof WP_Post ) { return false; } $api_vn = $this->api_vn; if( $api_vn == '' ) return false; $secret_key = $this->get_secret_key(); $public_key = $this->get_public_key(); return $public_key && $secret_key; }
@osaez: We are going to include a new and better version of the spam protection in the next patch. Please wait for that. If you want to test it now, check the private field.
Best regards,
IsmaelJuly 17, 2019 at 12:54 pm #1119566Hey,
@Ismael Thanks for your reply. However, your provided code does not work at all. Now my regular contact form in the page does not work, because recaptcha is not loaded anymore.
I looked through your provided code and does not unterstand why you scan for widgets and then look for a contact form in them. This does not make sense to me. I have a newsletter contact form in the footer area, but not as a widget. And on my contact page my contact form is in the main content.
I think the previous original code was fine that it looks for a contact form in the page. However, in addition it should also look for one in the footer area as$post->post_content
apparently does not include the footer area.
As a workaround I reverted to the original code and removed the regex check. This means, that recaptcha is loaded on every page, but my newsletter contact form is displayed on every page anyway.
I hope this gets a proper fix in the future.Regards,
DanielJuly 18, 2019 at 8:22 am #1119834 -
AuthorPosts
- You must be logged in to reply to this topic.