Pass variable to a chronoform through joomla menu

moshiani 26 Mar, 2012
Hi All,

I'm not sure what I'm trying to achieve is possible, I will try to explain.

I have two forms form1 and form2, which are accessed through joomla menu1 and menu2 respectively (the joomla menu type is 'chronoforms diplay form')

When user is on form1 they have an option to select an item from the dropdown list, based on item selected, form1 is reloaded with data from database and focus is still on the selected index of the dropdown, this is all works fine.

What I want to do next is when the user selects joomla menu2, reload form2 based on the selected index of form1. What options should I use for this? I've looked at the tutorials but I haven't been able to find anything to assist me with this.

I have tried using external URL from joomla menu and invoking the second form (with a hard coded selected_item variable for testing) as such: index.php?option=com_chronoforms&chronoform=form2&selected_item but I get the page not found error.

In summary, I'm trying to send a variable (selected dropdown index) from form1 to reload form2 via the joomla menu. Any tips will be greatly appreciated.
GreyHead 26 Mar, 2012
Hi moshiani,

Do you need to have the user choose a second menu item? Can you redirect or link them from the first form directly?

If you add a Data to Session action to the On Submit event of the first form and a Session to Data action to the On Load event of the second form AND give them both the same Session Key this will carry the data over.

Bob
moshiani 26 Mar, 2012
Hi Bob

Thanks for your reply. Yes I need the user to get to the second form via the menu.

If I have a simple navigation menu on chronoforms itself (such as Menu 1 Menu 2) just before the form I can use the custom code element with some simple PHP $_GET code that passes the dropdown selected index as a variable to the url link.

I want to achieve the same but through the Joomla menu, have been exploring doing this via an External URL menu type (instead of Chronoform Display Form) and set the url link to index.php?option=com_chronoforms&chronoform=FormOne

When I view the site I get no page found error and URL changes to
index.php/component/chronoforms/?chronoform=FormOne

Do you know why the URL change happens?

Also I have no submit button on the form, they are purely displaying information from the database based on selection from dropdown
GreyHead 26 Mar, 2012
Hi moshiani ,

The URL change is coming from your SEF URLs.

If your form isn't submitted then I don't know how you are going to pass data from it.

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