ChronoForms stores all the information about the current form in the $form object (an object is - more or less - a fancy variant of an array). Everything about the form is there somewhere.
For example, you'll find the form name in $form->form_details->name
A part of the $form object is a 'sub-object' where the current form data is saved. It's in $form->data.
At the beginning of the form On Load event the $form->data object is empty but very early on ChronoForms adds any variables that are in the $_GET array (that is data from the URL that called the form) and the $_POST array (that is usually data from a previous form step).
You can add more data to the $form->data object in the On Load event by using actions like the 'DB Record Loader' action, or the 'Session to Data' action. You can manipulate data using PHP in 'Custom Code' actions.
When the Show HTML action runs it will use the $form->data object contents (a) to 'Re-publish' values in form inputs and (b) if the Curly Replacer is turned, on it will use the contents of the object to replace {input_name} in the Form HTML.
Note that because PHP is run before the Curly Replacer you can't use the {input_name} curly brackets syntax in PHP; you need to use $form->data['input_name'] instead.
When the On Submit action starts exactly the same thing happens. The contents of the $_POST array - the form results - are added to the $form->data array and are available and/or used in all of the succeeding actions. Again you can use Custom Code actions and some others to manipulate or add values to the object.
One important difference from ChronoForms v3 is that the $form->data object is loaded once from the $_POST array, any changes to the $_POST array after that will have no effect on the data that ChronoForms uses. This is why the JRequest::setVar() methods used in many of the custom code snippets for CFv3 don't work in CFv4.
Comments: