Forums

Form with 3 dropdown

andreacnc 22 Oct, 2012
I created a form with wizard where there are 3 dropdowns that are populated from database and that are realized using 2 DynamicDropdwon with ajax events and DBMultiRecordLoader as FAQ.
Problems is that for one of this the 3rd is necessary a "GET" as this:
GET index?option=com_chronoforms&chronoform=nameform&event=ajax¶meter1=value1stDropDown¶meter2=value2ndDropDown.
How can i get access of value1stDropDown in 2nd DynamicDropdown?

Andrew
GreyHead 23 Oct, 2012
Hi Andrew,

You should be able to access each of the parameter values using $form->data['parameter_name']

Bob
andreacnc 23 Oct, 2012
Hi,
with $form->data['parameter_name'] I have access data inside of Db MultiRecodLoader, and not inside value selected in DropdDown in form, it's correct? Ajax Event in custom code there is:
$mainframe =& JFactory::getApplication();
$par = $form->data['parameter_name'];
echo $par;
$mainframe->close();

In this code $par is empty but first in form i selected a value of 1st dropdown!

Tnx

Andrew
GreyHead 23 Oct, 2012
Hi Andrew,

You should be able to use the $form->data[] syntax in any form event and it will pick up parameters from the calling URL.

Bob
andreacnc 23 Oct, 2012
Ok now I understand, but in case how is it possibile from a second DropDown that calling URL is:
GET index?option=com_chronoforms&chronoform=nameform&event=ajax¶meter1=value1stDropDown¶meter2=value2ndDropDow

and not default:GET index?option=com_chronoforms&chronoform=nameform&event=ajax¶meter2=value2ndDropDow

Tnx

Andrew
GreyHead 23 Oct, 2012
Hi Andrew,

Where exactly do you want to use this? If that is the calling URL then both $form->data['parameter1'] and $form->data['parameter2'] should have values.

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