Forums

session cookie to remember form completion

cjmicro 07 Jun, 2009
We need to add a session cookie so that if the user fills out the form, but has an error, the error pops up then takes them back to the original form (this part is done), BUT keeps their form info filled out so they can just correct the error, not start all over. (this is what I need help with!)

Joomla 1.0 (groan, I know)
Chrono 2.3.9

This is what I put at the top of the form code.

<?php
$_SESSION['uid'] = $my->id;
?>

Obviously (to you maybe <g>) this code is not working, so can anyone help me out? Thanks!!

I also found code with jfactory but I believe that is 1.5.

Thanks, Cheryl
GreyHead 07 Jun, 2009
Hi Cheryl,

I'm pretty sure that this is supported in Joomla 1.0 - use this code after the error is found
. . .
$error_found = true; // tell ChronoForms not to send emails or save data
showform($_POST); // reshow the form with the current values of the $_POST array
. . .

You need to make sure that the input values are set using $_POST.

Bob
cjmicro 10 Jun, 2009
Thanks Bob, that did the trick!

Cheryl
quantum_leap 29 Jun, 2012
Hi, I am trying to do the same on Joomla 1.5.26 and Chornoforms 3.2. I use
showform($_POST);
in my server side validation mbut it doesn't work. Is there a different method for Joomla 1.5?
GreyHead 29 Jun, 2012
Hi quantum_leap,

In CFv3 if you have 'Try to Republish' turned on in the General tab this should happen automatically.

Bob
quantum_leap 29 Jun, 2012
Just a quick one. Is it also possible to modify a value after the server validation gets executed? Basically I need to have all values republished apart from one which would be different. It would be a rel value to show one additional div. Would that be possible?
GreyHead 30 Jun, 2012
Hi quantum_leap,

I think that in Cfv3 you can add PHP into the beginning of the Form HTML then it will be executed at the right time to do this but you may need to experiment a bit.

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