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: CSM using Ajax when Enable ajax responses is set to NO

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

Tim Lloyd

Jun 15, 2012

Hi,

I’ve upgraded to 2.4 and I’m using Structure 3.2.4 and EE 2.5. Since upgrading, when I submit any form that is a success, I get the error:

AJAX Error
The response was not a valid JSON object. Close

Appear in a Jquery dialog.

If I look at Firebug, it’s issued a GET request for the return=”” parameter but is trying to process it as Ajax. I’ve set the option “Enable ajax responses” to NO but it has no effect. I don’t need to use Ajax, just for it to honour the return=”” tag on success. I also have Bypass the message template entirely on successful actions? set to YES.

Appreciate your help…

Tim

#1

BoldMinded (Brian)

What type of form are you using the ajax submit with? There are some forms in EE that simply don’t accomodate an ajax submission… they expect a browser redirect, not an xml or json response, thus it won’t work. If you look at the actual response text in Firebug it’ll most likely contain a full HTML page, which is why it isn’t working.

#2

Tim Lloyd

Hi,

Yes, I am getting a full HTML page in the response.

I’m using this with FreeForm from Solspace and the tag looks like this:

{exp:freeform:form form:id=”quote_form” form:name=”quote_form” collection=”Request quotation” return=”products/thanks/{segment_3}” notify=”xxxxx@xxxxxx.com” template=”quote_request” send_user_email=”yes” user_email_template=”external_request_quote” }

I don’t want it to use AJAX but just use the return=”” parameter. Instead, this appears to be included via the AJAX call. I have told CSM not to use AJAX, which is the baffling bit.

#3

BoldMinded (Brian)

Tim, what version of Freeform are you using?

#4

BoldMinded (Brian)

Also, do you have a URL available where I can look at the form?

#5

Tim Lloyd

Hi,

Sure, the form can be found here with the problem: http://www.censornet.com/en/products/quote/censornetpro

Freeform 3.1.4

Thanks…

#6

BoldMinded (Brian)

Tim, sorry for the delay, I must have missed the email notifying me of your follow up comment. Are you still having trouble with this?

#7

Tim Lloyd

Yes but I found a dirty workaround which was to edit pi.system_messages.php and on Line 209 add:

form.action = “”;

This meant the JQuery Ajax stuff shouldn’t run, which it shouldn’t anyway was a AJAX requests were disabled in the System Messages plug-in option, so not sure if its a bug or just my set up with the various plug-ins already installed.

Login to reply