I have succeeded in creating a work-flow that takes me back and forward through my multi-page form. However, I have a problem if I return to the first page. If I set the Mult-Page action to Reset data 'Yes', I begin with a clean form (which is good), but if I work through the form but then return to the first page I lose all the data. If I leave Multi Form configured with Reset Data 'No' I get data from my previous run included.
I need a way of clearing it when I start, but not subsequently. One option might be to have a hidden page right at the beginning that is driven by the On Load action where the variables are re-set, with that automatically going to the next page, which is displayed and gathers information. Any return I do then goes to that page and not the Load Action.
Is there any way I can do that? Are there any other options? I am sure others have been down that route!
I need a way of clearing it when I start, but not subsequently. One option might be to have a hidden page right at the beginning that is driven by the On Load action where the variables are re-set, with that automatically going to the next page, which is displayed and gathers information. Any return I do then goes to that page and not the Load Action.
Is there any way I can do that? Are there any other options? I am sure others have been down that route!
Hi EX34Mush,
One way to do it would be to add a parameter to the URL when you first load the form to say 'new' load. Then you can use an Event Switcher to check that and either load a Multi_page action with reset or one without.
If you load the form from a menu the latest release has a setting that lets you add a parameter there. You'd need to unset it after checking to make sure it wasn't show again when you page back.
Bob
One way to do it would be to add a parameter to the URL when you first load the form to say 'new' load. Then you can use an Event Switcher to check that and either load a Multi_page action with reset or one without.
If you load the form from a menu the latest release has a setting that lets you add a parameter there. You'd need to unset it after checking to make sure it wasn't show again when you page back.
Bob
HI again,
It's not going as I had hoped. At the moment I am just testing the principle.
In the Joomla menu option I have added a ChronoForm menu item, and on the Options tab entered the name of my form.
I then added 'new' to the parameter text box.
On my test form I added debug to the event.
When I click on the menu item it taks me to my test form, but I had expected to see the value of my parameter in the debug data, but nothing is shown. When I check the URL is see the name of the form, but no parameters.
I see from the menu tooltip that the parameter data should be in cf_mp, so have tried adding cp_mp='new' to the menu parameter box to see if that makes any difference. Also tried adding an event to the menu page but that does not appear in the URL either.
Should I expect to see the URL change? If so, any ideas what might b wrong?
It's not going as I had hoped. At the moment I am just testing the principle.
In the Joomla menu option I have added a ChronoForm menu item, and on the Options tab entered the name of my form.
I then added 'new' to the parameter text box.
On my test form I added debug to the event.
When I click on the menu item it taks me to my test form, but I had expected to see the value of my parameter in the debug data, but nothing is shown. When I check the URL is see the name of the form, but no parameters.
I see from the menu tooltip that the parameter data should be in cf_mp, so have tried adding cp_mp='new' to the menu parameter box to see if that makes any difference. Also tried adding an event to the menu page but that does not appear in the URL either.
Should I expect to see the URL change? If so, any ideas what might b wrong?
Obviously not a good idea to post two consecutive comments from the same writer as it must look to you as though it has been answered. I have a workaround for this, but would be good to get things working properly.
Any thought on my problem?
Any thought on my problem?
Hi EX34Mush,
You can use multiple "data to session" and "session to data" actions, and set the last "session to data" action in the last page (confirmation page) to "clear the session".
Best regards,
Max
You can use multiple "data to session" and "session to data" actions, and set the last "session to data" action in the last page (confirmation page) to "clear the session".
Best regards,
Max
Thanks, but my query at this stage was to understand if I should see the parameter in the URL. Bob had suggested passing a parameter from the menu link, but it did not seem to work - or at least I was not seeing any parameter appended to the URL.
If I should be seeing the parameter, I wondered why I wann't
If I should be seeing the parameter, I wondered why I wann't
Well, I think Bob means to add the parameter to the link manually, like creating a menu item of type link and use the form link + the parameter: form_link¶m=value, then in the event switcher:
If you set the parameter in the menu item config then you will need to grab its value using php code.
<?php
if($form->data("param") == "value"){
//some code
}
If you set the parameter in the menu item config then you will need to grab its value using php code.
Thanks again. Actually, in the Joomla menu item option for ChronoForms there are fields for adding a parameter or specifying which Event to trigger. (Useful if yu don't want your workflow to start with Load). I can see how Max's solution could work, but in fact I now have a workaround that is doing the job of clearing the variables.
Thanks anyway.
Thanks anyway.
Hi EX34Mush,
I'm sure that I set this up months ago in a way that would automatically add value to the $form->data - but I can't find that this evening.
If you add this code to a Custom Code action in the form On Load event it will get the value of cf_mp from the menu settings:
Bob
I'm sure that I set this up months ago in a way that would automatically add value to the $form->data - but I can't find that this evening.
If you add this code to a Custom Code action in the form On Load event it will get the value of cf_mp from the menu settings:
<?php
$app = \JFactory::getApplication();
$params = $app->getMenu()->getActive()->params;
$form->data['cf_mp'] = $params->get('cf_mp');
?>
Bob
This topic is locked and no more replies can be posted.
