All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: “The response was not a valid JSON object.” on form success

Status Resolved
Add-on / Version Custom System Messages
Severity Critical
EE Version 17

Heiko

Oct 02, 2012

Hi there,

I’ve read all the other tickets, but couldn’t find a solution.

I’m using CSM v2.4.2 on a Zoo Visitor registration form - with a valid return path - and the validation is working beautifully, except when the form submission succeeds.

In that case, I get this error: “The response was not a valid JSON object.”

My CSM settings are:

Enable ajax responses? - YES.
Bypass the message template entirely? - YES.
Redirect to the defined error template? - YES.
Accessibility. - NO CHANGE.

I’ve also tried to set json=“yes” on the ZV form, but then CSM is bypassed completely.

This is the form from my template: http://pastie.org/4895744

Can you please help?

#1

BoldMinded (Brian)

Look at the Network tab in your console, what is the response content? e.g. https://skitch.com/litzinger/esk5t/boldminded

#2

BoldMinded (Brian)

My guess is Zoo Visitor is immediately doing a redirect after the submission, which is not a valid JSON response, hence the error you’re getting. Try setting the message_on_success parameter to no, e.g.

{exp:system_messages:form message_on_success="no"}
#3

Heiko

Thanks for your help!

I set the parameter to “no”, but the error prevails.

I’m not sure what to look for in the inspector, but I get a warning in the console:

The page at https://mysite.com/register ran insecure content from http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js.

#4

Heiko

I just noticed that the form is submitted, although the redirect doesn’t take place. When I refresh the page directly after form submission, the data is entered correctly and the user logged in.

#5

Heiko

OK, at least I figured out why the the warning occured. Unfortunately it wasn’t related to out problem here. 😛

#6

Heiko

BTW, the issue doesn’t occur with ZV forms only. I just tested it on a native Safecracker form and it’s the same there.

#7

BoldMinded (Brian)

Can you share the URL so I can see the forms in action? You can edit this ticket and save it to the details, then only I’ll see it.

#8

Heiko

Man, I updated the ticket, but no changes have been saved. Happened more than once, while editing in general. :(

#9

Heiko

Uppps, they WERE saved! 😉

I have to send you the URL in question plus .htaccess credentials. Shall I do so via email?

#10

BoldMinded (Brian)

I see the credentials in the ticket, did you not see them when editing?

#11

Heiko

No no, I was just confused… it happens! 😉

#12

Heiko

So, any new insights? I’m waiting desperately.

#13

Heiko

OK, never mind, I’ve just set up some redirects to custom templates, which is already awesome enough! 😉

Thank you.

Login to reply