Forums

ChronoForms dies when saving form...

ignite 26 Feb, 2010
Hey folks,

This is my first post to the board. I've got an installation of CF that I've inherited. The form in question has address fields and the states and countries are being dynamically added to the <select> fields with some php. In the past this has worked fine. We upgraded to the latest version of CF, about a month or so ago. Today when trying to duplicate a form and edit the code and test it, it now stalls when saving, showing me a partial view of the form html which ends at the first PHP code block, the rest of the page is blank. Am I missing a setting or did something change in the latest version that I'm not aware of? Any help is appreciated. Thanks.

- ignite

(btw, I'm using ChronoForms_V3.1_RC5.5)
nml375 26 Feb, 2010
Hi,
This is caused by a nasty "feature" of ChronoForms. Upon saving, it will execute the form html code, and check the result for field inputs and their names. This works well enough for simple forms, but with some more advanced php-coding, things might break, interrupting the save-process..

There is, however, a simple workaround; add the following lines to the top of your form:
<?
global $mainframe;
if (!$mainframe->isSite()) {
  return;
}


That will prevent the php-code execution in the backend/admin section, but will let it work as intended on the site.

/Fredrik
This topic is locked and no more replies can be posted.