Forums

How can I keep the data of the variables after the show form ?

AntonioGraca 06 Feb, 2014
Hello Bob and Max
I need your help (once again...). I need to make a call to for a club , something like the issue of an invoice. The scheme is the same as if the introduction of a bill items. If we take the example of the bill, it would then be the following: With a form to choose and introduce the client, which I will send the invoice, then according to the choice on this form, advancing to a second form for the introduction of products. And here is the trouble begins.
I want to introduce a product and come back another time to the second form without losing the values ​​of variables (which were introduced in the 1st form and passed to the 2st form) that contains customer data for which I am to pass the bill. At the same time, this second Form, which introduce the articles, there is a tab which shows the result of all this, ie, the header of the invoice to the customer and the various rows with the items of articles introduced.
But is not working. I can get the data from the first to the second form, but the problem is that after save the first article, when I come again to the 2nd form, I lose the variable values passed of the 1st form to the 2st.
How can I keep the data of the variables after the show form ?
I'm doing this:

In fisrt form, in submmit
Data To Session

In second form, in load
Session To Data
a custum code to pass the value of variable to the form (like this, $form->data['competicao_convoca']=$competicao_escolha;)

In second form, in submmit
To enter a new line with an article I need to call again the 2nd form
Show form (the same form)
AntonioGraca 06 Feb, 2014
Thanks, calculus00😀 A goog colection of link, maybe help... but...Bob and Max
Well, I think the last time I had a light that enlightened me. I guess I was not quite understand the philosophy of Session to Date / Date to Session. I change the following:

In second form, on load
I put a Data to Session

In second form, on submmit
I put a Session to Data

I think is working well. I ill go a hard test to confirm..

Thanks Max and Bob
Nice to meet you, calculus00. I think it can be a good help ...😀
AntonioGraca 06 Feb, 2014
Hi max and Bob and... Prof calculus00😀
I have an problem. With this configuration, when I submmit a new item in data table record two lines. One record with all data (ok) and other without data stored in the Date to Session only automatic data record by chronoforms.

Some light, please?

Thanks
AntonioGraca 06 Feb, 2014
When I click in submmit, show form reload the form, made refresh the page and made other record in data table...😟
GreyHead 07 Feb, 2014
Hi Antonio,

It looks as though you aren't updating the data in the session in the On Submit event of the second form.

Personally, in this case, I'd probably save the data to two database tables. one for the master record and the second for each 'Form 2' submission. Then you can reload the data each time Form 2 is loaded.

Bob
AntonioGraca 07 Feb, 2014
Hi, Max
Thankyou for your replay.
I did several tests to see what was happening. At this time the form dont have the events Data to Session and Session to Data. The form continues to record a complete record with all the information, and then 2-3 seconds after recording, save another record only with the information automatically recorded by ChronoForms (id, date, ip adress, etc.).
If I open the form in form wizard and press Test Form, the form writes only one record in table. But, if I test the form pressing Frontend View save two records (one with complete information and the other with only the basis of specific information ChronoForms).
I do not understand. With this information you can see what's going on?

Thanks
António Graça
Max_admin 07 Feb, 2014
Hi Antonio,

The session actions have something called the "session key", did you make sure they are configured to the same value ? since you are using 2 different forms then you must configure them, and they must be the same!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
AntonioGraca 07 Feb, 2014
Hi Max and Bob (sorry bob, i change your name in last post😟 )
The last test was only one form (form2). With no session action... The same form, called in diferent wy, returne results diferents. Read last posta with atention, please...

Tankyou
António Graça
Max_admin 10 Feb, 2014
Hi Antonio,

Then maybe this is some plugin or module or template config on your website, please switch the template and test, then disable any 3rd part system plugins, then modules, until you find out what's doing this!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
AntonioGraca 17 Feb, 2014
Answer
Hi Bob and Max

I want to introduce a product and come back another time to the second form without losing the values ​​of variables (which were introduced in the 1st form and passed to the 2st form) that contains customer data for which I am to pass the bill. At the same time, this second Form, which introduce the articles, there is a tab which shows the result of all this, ie, the header of the invoice to the customer and the various rows with the items of articles introduced.



To solve the problem of duplicate record (one with complete information and the other with only the basis of specific information ChronoForms), I change of show form to redirect url in submit action.

I use two form, the first form call the second and each time I press the button submit in the second form return again to the second form to add more record. The Data to Session and Session to Data is work fine too.
In conclusion, everthing work fine now.

Thanks Bob and Max
This topic is locked and no more replies can be posted.