How do you preserve values derived and stored on page 2 across later pages

wallyhowe 31 Oct, 2021
I am clearly missing something obvious in getting to grips with Chronoforms 7.Values I store from page 1 get preserved throughout the form but values stored on page 2 are not preserved across pages.

I am using a form to work out which invoices are due each month.
I have a set of hidden fields that are used to drive behaviour of the form.
On page 1 some fields are taken as form inputs (e.g. month)
Some are found and stored via PHP such as year:
$year = date('Y');
$this->data['year'] = $this_year;
These fields are preserved as I go through the pages as evidenced by the debugger.

Then on page 2 there are fields that are found and stored by database query within a PHP block such as count of social invoices due:
.....
$result = $db->loadResult();
$this->data['count_social'] =$result;

Ditto for tennis and squash.

and some are derived by expression and stored such as due date
$duedate="01/".$month."/".$year;
$this->data['duedate']=$duedate ;

These show up in debugger on that page and appear in messages produced by that page.

However, when I move to the page 3 to use these fields stored on page 2 (duedate, count_social, count_tennis, count_squash) to produce the invoices none are produced and the debugger shows these fields as being empty.

How do I store these derived values from page 2 to preserve them across later pages?

Thank you for the help

Wallyhowe
You need to login to be able to post a reply.