Data saved only when using view form from the admin

How to fix a CF form that saves data only when viewed from the admin panel.

Overview

The issue occurs because the form's relative URL setting or an ID parameter conflict prevents data submission when embedded in a site article.
First, set the 'Relative URL' option to 'NO' in the HTML action settings. If that fails, add a custom code action to unset the ID parameter during form submission.

Answered
pa pataroller 08 Sep, 2014
Hello,

I have a problem when submitting a form placed into a page of my site, datas are not submitted to the base. But my form is perfectly submitting datas when I use the viewform button in the admin.

What's wrong ?

Thanks
Max_admin Max_admin 09 Sep, 2014
Possible fixes:

#1- use your form using a menu item of type chronoforms5 instead of loading it in article.
#2- set the "Relative url" under the "HTML" action settings to "NO" and keep your form inside the article.


#3- if you choose #2 and it doesn't work, then you may need to reset the id parameter, add this code inside a custom code action to the top of the "on submit" event:

<?php
unset($form->data["id"]);


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pa pataroller 09 Sep, 2014
Answer
Many thanks for your quick answer.

Insering a custom code action in my form seems to be the right issue.
I found another topic with the same issue:
http://www.chronoengine.com/forums/posts/f22/t96969/form-does-not-save-via-article-but-works-via-testform-link.html
Code is a little different but the idea is the same.
This topic is locked and no more replies can be posted.