Hi I loaded the session data in the form load!
How can I retrieve the session data?
e.g. session->get("my_data");
I am going to do the following:
If session data is not empty, I want to skip the form!
If empty, I will be required to fill the form.
Looking forward to your reply.
Thanks.
How can I retrieve the session data?
e.g. session->get("my_data");
I am going to do the following:
If session data is not empty, I want to skip the form!
If empty, I will be required to fill the form.
Looking forward to your reply.
Thanks.
Hi likigoldenstar,
You can use the Session to Data action to recover ChronoForms data saved with a Data to Session action.
Otherwise you can use the Joomla! code in a Custom Code action:
Bob
You can use the Session to Data action to recover ChronoForms data saved with a Data to Session action.
Otherwise you can use the Joomla! code in a Custom Code action:
<?php
$session =& JFactory::getSession();
$some_var = $session->get('xxx');
. . .
?>
Bob
Hi,
what is the difference between using
and
Thanks
DSPWEB
what is the difference between using
<?php
$session =& JFactory::getSession();
$some_var = $session->get('xxx');
. . .
?>
and
<?php
$var = $form->data['xxx'];
?>
Thanks
DSPWEB
Hi dspweb,
The first one gets a value from the User Session, this could be data from the form but doesn't have to be.
The second one sets a variable to a value from the ChronoForms $form->data[] array; ChronoForms pre-loads this with values from the URL and from a form when it is submitted (and some other things).
Bob
The first one gets a value from the User Session, this could be data from the form but doesn't have to be.
The second one sets a variable to a value from the ChronoForms $form->data[] array; ChronoForms pre-loads this with values from the URL and from a form when it is submitted (and some other things).
Bob
Thanks Bob,
So if I had a multi-page form, which method should I use to read the variables that I saved with the action 'Data to Session'?
Thanks,
DSPWEB
EDIT: Another question is: For reading saved data i should use
OR
So if I had a multi-page form, which method should I use to read the variables that I saved with the action 'Data to Session'?
Thanks,
DSPWEB
EDIT: Another question is: For reading saved data i should use
<?php
$var = $form->data['xxx'];
?>
OR
<?php
$var = $_POST['xxx'];
?>
Hi dspweb,
If you add a 'Session to Data' action at the beginning of the event then ChronoFroms will copy the saved data from the Session back into the $form->data[] array.
Bob
If you add a 'Session to Data' action at the beginning of the event then ChronoFroms will copy the saved data from the Session back into the $form->data[] array.
Bob
Thanks Bob,
I've another question for you.
I have a multipage form with 'dynamic dropdown' action;
when I insert values and click submit, I show a confirmation page.
I have add two buttons like 'CONFIRM' and 'MODIFY';
If I click on 'MODIFY' the form come back to the previous page, and all the fields had the same value except the 'dynamic dropdown'.
How can I fix this?
PS: Excuse for my english 😶
I've another question for you.
I have a multipage form with 'dynamic dropdown' action;
when I insert values and click submit, I show a confirmation page.
I have add two buttons like 'CONFIRM' and 'MODIFY';
If I click on 'MODIFY' the form come back to the previous page, and all the fields had the same value except the 'dynamic dropdown'.
How can I fix this?
PS: Excuse for my english 😶
Hi dspweb,
I'm not sure how to get this to work. It must be possible. Somehow the options list needs to be recreated when the page loads. How are you getting the options for the dynamic drop-down? It may be simplest to re-run the Ajax call on the page load.
Bob
I'm not sure how to get this to work. It must be possible. Somehow the options list needs to be recreated when the page loads. How are you getting the options for the dynamic drop-down? It may be simplest to re-run the Ajax call on the page load.
Bob
Thanks Bob,
I'm sure it is not in the correct topic, but I have another question.
This is my situation:
Multi-page form + forward button and back button in the second page.
Why if I click the back button, the previous object 'formCheck_form_name' (referred to the first page) disappears?
I'm sure it is not in the correct topic, but I have another question.
This is my situation:
Multi-page form + forward button and back button in the second page.
Why if I click the back button, the previous object 'formCheck_form_name' (referred to the first page) disappears?
This topic is locked and no more replies can be posted.