Contact Form 7 JSON Parse error: Unrecognized token '<'

https://www.thermostatportal.com

I am using Contact form 7. I am getting an error: JSON Parse error: Unrecognized token ‘<’ when trying to submit the form. Test with M4L1X3.

I disabled plugins but it still happens.
If I put add_filter( ‘wpcf7_load_js’, ‘__return_false’ ); in the functions.php, it works but that kills my date picker and I am not allowing CForms JS to load.

I think there is a JavaScript conflict? Or is it my form itself?

Thanks for your help!
GJ

Hi @geoffj,

Thanks for writing in.

I could not see any script conflict on your setup. This could be because of the form itself. Please try to reinstall your contact form 7 and Use a new form.

Let us know how it goes.

You might want to check the link below:

Thanks.

Thank for this. It is happening on two different forms. I’ll give it a go. Do you understand what the error means or why it will not send? Thanks!
GJ

Hi GJ,

It seems to be a JavaScript/AJAX related conflict. As an alternative solution, could you please try using SMTP plugin and see if that helps (https://srd.wordpress.org/plugins/wp-mail-smtp/).

Let us know how it goes.
Thanks!

Thanks.

I am actually using easy-wp-smtp and Contact Form CFDB7. I will try what you sent.

File upload in Safari is a part of the problem on 1 of may forms. https://wordpress.org/support/topic/when-typefile-is-set-in-contact-form-7-it-does-not-work-with-safari-ver-11-1/

A nightmare…

Maybe this will fix the file upload part?: http://preview.codecanyon.net/item/contact-form-7-drag-and-drop-files-upload-multiple-files-upload/full_screen_preview/20683653?_ga=2.2975539.2080118028.1527025706-129240964.1468859274

Thank for your help. Under the gun on this one.
GJ

Working locally gave a fatal error activating:

Fatal error: Class ‘WPMailSMTP\Core’ not found in /Applications/MAMP/htdocs/hecsmartthermo/wp-content/plugins/wp-mail-smtp-2/wp-mail-smtp.php on line 74

Hi There,

According to the above error, either it conflicts with PHP version or the plugin is not installed properly.

Check and make sure that you’re using PHP v5.6.x or later to avoid incompatibility issue. If you’re already using a PHP version greater that 5.6.x, you can try re-installing the plugin.

Hope that helps.

thanks. using 5.6.2. i was able to install 2nd time, however, it did not help my issue.

Hi @geoffj

I’ve checked your form and this was the response I got in the browser console:


This is the full error message:

<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/heccontr/public_html/wp-content/themes/pro-child/functions.php:112) in <b>/home/heccontr/public_html/wp-includes/rest-api.php</b> on line <b>545</b><br />

I suggest following this guide to fix this issue, you can also try switching to the parent theme and recheck this issue as the problem seems to be in functions.php file in your child theme.

Thanks.

Alaa,

I must say a great big thank you to you sir! I have been chasing this completely the wrong way. Thank you! Thank you! Thank you!

Is that Chrome you are using? My console is much different.

Thanks!
GJ

Helllo @geoffj,

You are most welcome. Yes, that’s Google Chrome. :slight_smile:

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.