Forums

Easy question on multi-page pass a value

gtownwebdev 28 Dec, 2009
I have read EVERY post under the multi-page plugin tutorial and still can't quite get this! It's got to be something simple.

I have a multi-page form up and running and working great, but the second form won't display the cf_id value from the first. It's bringing over all the data so it must be there somewhere (and the data is saved into a new record after the first form is submitted), but it won't display.

Enter any any old thing in the first form to get to the second (no fields are required):
http://draft.masc.org/index.php?option=com_chronocontact&chronoformname=AdminSteps&user_id=92

You can see from the debug on the screen when you get to Part 2 that all the fields are available, although I don't see cf_id and no matter how I try to call it, it won't show up.

I used this in the second form:

<?php
$session =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>

And then later tried adding the form name, so 'chrono_formpages_data_AdminSteps' -- no difference. When I submit the second form, two records are created with two cf_ids. The data from the first form IS carried over -- everything BUT the cf_id!

Right now the DB Connection is turned on for all 3 parts (mother and 2 children) -- if I turn off the second/last DB connection as some posts suggested, e-mails still go out but the data from the second form doesn't get saved at all. If I turn off the DB connection on both children, e-mails still go out but no data gets saved to the database, even though the mother form has the DB connection turned on. The only way the data gets saved is for all 3 to have the db connection turned on ... but I get two records instead of one.

How do I get that cf_id to carry over??
GreyHead 28 Dec, 2009
Hi gtownwebdev,

I'm not sure what is happening without tracking through step by step.

Unless you particularly need to save to the DB after each step then it should be enough to enable the DB Connection on the mother form (or the last step).

You do not need to create the $posted array in the current release, ChronoForms does that for you.

Bob
gtownwebdev 28 Dec, 2009
That's good to know about not needing the array, I took it out. Here's the scoop:

If I disable e-mails, and just have one DB connection in the mother form, I get a record (but no e-mails of course). When I enable e-mails, I get no record. :-( If I turn on the DB connection in the individual forms, I get TWO records!

How can I enable the e-mails but still get a record created in the table?

I e-mailed you a login -- please, please take a look and see if you can help me.

Thanks,
Laurie
GreyHead 29 Dec, 2009
Hi Laurie,

If disabling emails stops the DB saves then you probably have the DB Connection set to 'Before Emails' - change it back to the default setting of 'After Emails' that all should be OK.

Bob
gtownwebdev 29 Dec, 2009
I really, really thought this might be it ... but it wasn't. You're right, I had them set to "before" instead of "after." I changed all three (mother + 2 children) to "after."

No luck. The e-mails get sent but no record gets created.

Thank you for all your help, especially around the busy holiday time. Would you please see if some other setting might be wrong?

:-(
gtownwebdev 30 Dec, 2009
I think I got this working. I don't know what made the difference -- I turned e-mails and db connections off and on so many times in all three forms, trying to find the right combination -- somewhere along the way it clicked. I think maybe what did the trick was turning on the e-mails in the mother form, even though it has no e-mails of its own.

It now looks like it is sending the e-mails AND creating a record -- just one record! -- just what I needed.

WHEW! Thank you for your help.
This topic is locked and no more replies can be posted.