Temporarily suspending php

I have developed a form that runs some jQuery in the OnLoad event. I suspend PHP using ?> before the jQuery code and restart it using <?php afterwards. The jQuery code works fine and produces the results I require. However, when running the form and clicking on the ‘Save’ button I get the following window appearing -

I initially suspected something wrong with my jQuery code, so removed that just leaving the ?> and <?php. I still get the same result as shown in the screenshot above. If I remove the php off and php on tags then all is fine. The issue is therefore with turning off php and turning it on again.

I have seen this approach used i.e. turning off php and then on again in several Scriptcase blogs and was keen to use it. Anyone have any ideas?

Hi there
Do you have the Ajax debug output turned on?
Application > Settings > Ajax Error Output

Ah yes. Thank you so much. The simplest answers are always the best!.

1 Like