Forums

caching $this->data?

guillegarcia 23 Jun, 2020
Hi there,

I'm a newbie with Chronoforms and Joomla, sorry in advance if my questions is unprecise or lacks detail.

I have several forms that I use both to create and edit (via a token in the URL). My problem is that, whenever I fill and submit a form, the next time I get into the same form, all the inputs are prefilled with the last data they had. This is because I'm using {var:read_data.model.myInput} (for example) to load data only when a token is provided in de URL, but even when I don't have a token in de URL the data is still there, it is the "$this->data" array. I've tried to empty that array in the submit event with no success. Can anyone help me with this?

Thank you very much.
Max_admin 25 Jun, 2020
which data is there ? the one from the "read_data" or the last data submitted by the form ?

If it's the last data submitted then you may try to disable the "follow pages order" setting in the form settings (assuming your form is 6.1), OR, better try to download v7 RC2 and use it to build this form
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
guillegarcia 25 Jun, 2020
After some more testing, it's actually the "read_data" data that is getting "stuck". This is the way it's behaving right now:
  1. I load my form with a token in the URL, and the form is rendered with the corresponding inputs filled with the data returned in "read_data".
  2. Right after that I load my form but without the token in the URL, and the form is prefilled with the data from before.
Is there a way I can prevent this from happening? The behaviour I'm specting is that the form renders with the inputs clean when no token is informed. I'm quite sure I'm doing something wrong, but I cannot figure it out.

On the other hand, I'd really want to avoid to migrate to CF7 given the sheer number of CF6 forms in my project.

Thanks for your answer
Max_admin 25 Jun, 2020
you can install v7 and use it for this form only!

but for this issue on the v6 form, please enable the form debug and post the debug data in both situations!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
guillegarcia 26 Jun, 2020
Hi,

this is the debug data with token and without token:
  1. with token:
  2. And without token:

I load the data in the "load" event with an "If Conditions", as shown:


And this is how the form is configured for every input:
This topic is locked and no more replies can be posted.