Forums

MultiPage Recipe or Question

kdbates 25 Mar, 2011
Hello All,

I am looking for a recipe or documentation for a MultiPage process where at the end of part of the form you can choose to Save and exit or log off. This would save data to the database and when the visitor logs back on to the site they are given back the data from where they left off. I do not suppose this exists already? This would be similar to a job application process.

If someone has experience doing this in ChronoForms, maybe I could get a high level overview of this process?

Thanks in advance for any feedback.
kevin
GreyHead 26 Mar, 2011
Hi Kevin,

Provided that (a) you save the data at each 'child form' step and (b) add code to the Form HTML to check the User ID and see if they have saved data then this is fairly straight-forward.

Bob
kdbates 30 Mar, 2011
Thank you Bob for answering this question.
I am wading through the recipe for MultiPages in your book. And I am confused about the 3 snippets on page 344 and 345.

Does this snippet go at the head of each child form?
<?php
if ( !$mainframe->isSite() ) {return;}
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data_application',
array(),
md5('chrono'));
?>


Same question for this snippet - would this snippet come after the code above?
<div class="form_ietem">
<div class="form_element cf_text">
<span class="cf_text">Reminder to applicant where they left off?
<strong><?php echo $posted['text']; ?></strong></span>
</div>
<div class="cfclear"> </div>
</div>


Again, where would this snippet be placed?
<?php
$MyForm =& CFChronoForm::getInstance();
$data =  $MyForm->tablerow['jos_chronoforms_empapp'];
?>
<input type='hidden' name='cf_id'
value='<?php echo $data->cf_id; ?>' />


I am sorry that I have to be spoon fed but I am confused by the instructions in the recipe.
Thanks!
kevin
GreyHead 02 Apr, 2011
Hi kdbates,

The first snippet goes first as it defines $posted -- and you may not need it any more as I think later versions of the plug-in had $posted ready defined. The the other snippets follow in the order that you have them.

Note that you can download all the code in the book from the PacktPub site -- in some cases this may be easier than reconstructing it from the book.

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