Hi,
A few comments:
The 'tablerow' property of the CFChronoForm object is only filled after the DB storage is completed, and cannot be used to retrieve a JTable instance from an earlier submission - That is, if you store data from Form1 in jos_chrono_form1, then you cannot read that from within Form2, but only in the "post processing" part of Form1 (on submit - after email).
Adding a hidden cf_id input will not work as planned. CF uses JTable objects for DB storage, these have a very important behavior: If the primary key is assigned a value, then JTable assumes this row already exists, and tries to edit it rather than adding it as a new record. But, since we're trying to add a new record, the "UPDATE TABLE SET ... WHERE cf_id = 123" SQL-query will silently fail.
The uid column is filled by default with a hashed random value, which cannot be trusted to be unique to the user or session. That is, two users may very well end up with identical uid values along the road. Your best bet for a unique identifier would be the primary key value of the first table.
To fetch the cf_id from the inserted data, and store it in the session storage; I'd use the following code on the "on submit - after email" code of the first form (form_start):
<?
$session =& JFactory::getsession();
$session->set('primary_key', $MyForm->tablerow['jos_chronoforms_form_start']->cf_id, 'mynamespace');
?>
Then, on the following forms, I'd either add a hidden form input (simple, but users might fake this), or use the "serverside validation" code to verify that the session value exists and add it to the form field values posted:
<input type="hidden" name="parent" value="<?
$session =& JFactory::getsession();
echo $session->get('primary_key', 0, 'mynamespace');
?>" />
or
<?
$session =& JFactory::getsession();
$t = $session->get('primary_key', 0, 'mynamespace');
if ($t == 0) {
return "You have to complete the first form!";
}
JRequest::setVar('parent', $t, 'post');
?>
Finally, once the last child-form has been completed, clear the session data:
<?
$session =& JFactory::getSession();
$session->clear('primary_key', 'mynamespace');
?>
The code is not tested, and written from memory, so it will most likely need some debugging. It also assumes that each "child" DB-table has a row named "parent", which links the child to the "parent" (jos_chronoforms_form_starts).
/Fredrik
Edit: Two minor typos sorted.