Hello, I have a Dropdown, the id is fkIdDepartamento, here I make a call to the BD and I load information from the bhumkcom_departamento table.
I need to do a dynamic Dropdown with the id fkIdMunicipio. When you select any option in the fkIdDepartment, show me the value of the field nameMunicipality where the field fkIdDepartment is equal to the value of aid of the table bhumkcom_departamento.
Try something but I do not know where to put that condition.


I need to do a dynamic Dropdown with the id fkIdMunicipio. When you select any option in the fkIdDepartment, show me the value of the field nameMunicipality where the field fkIdDepartment is equal to the value of aid of the table bhumkcom_departamento.
Try something but I do not know where to put that condition.



Put a model name in for the second table and click "Add New Model"
Hi healyhatman, please give me an example.
Where can I see how it should be written correctly?
Where can I see how it should be written correctly?
Just give it a try.
Related to: model name of the first table
Relation: Whatever makes sense
Foreign key: use this if you've properly set the foreign key / primary key, or just use------>
Relation Conditions: There's an example underneath this field.
In the first model, under fields to retrieve, you would do FOR EXAMPLE
model1.fieldname
model2.otherfieldname
Related to: model name of the first table
Relation: Whatever makes sense
Foreign key: use this if you've properly set the foreign key / primary key, or just use------>
Relation Conditions: There's an example underneath this field.
In the first model, under fields to retrieve, you would do FOR EXAMPLE
model1.fieldname
model2.otherfieldname
They are two different dropdown.
What event do I put in dropdown where must show the MUNICIPIOS?
I put the RELOAD event, but it stays loading the form. As you can see in white.
Without the RELOAD event, look at the DEBUGGER what it shows.
What event do I put in dropdown where must show the MUNICIPIOS?
I put the RELOAD event, but it stays loading the form. As you can see in white.
Without the RELOAD event, look at the DEBUGGER what it shows.

Have you looked at the dynamic dropdown demo?
healyhatman, Yes, sir.
It does not work for me because I have to load data from the database and save another field different from the one I show in the dropdown.
I tried it and could not do it, without using the php code.
It does not work for me because I have to load data from the database and save another field different from the one I show in the dropdown.
I tried it and could not do it, without using the php code.
If you're using a database read for a dropdown, it needs to be set to "return an array of key/value pairs" and you need to have two fields in the fields to retrieve box - the VALUE you want in the dropdown option and the LABEL you want for the dropdown option
For the dropdown, under advanced -> Reload Event, put the name of your reload event. Let's say you have an event called "reload_municipo" then you'd put "reload_municipo" in there.
As long as the value of the dropdown corresponds to a value in the other table you want there shouldn't be any problem doing it. Just follow the Dynamic Dropdown demo, except instead of the PHP you have a read data action set to "Return an array of key/value pairs".
As long as the value of the dropdown corresponds to a value in the other table you want there shouldn't be any problem doing it. Just follow the Dynamic Dropdown demo, except instead of the PHP you have a read data action set to "Return an array of key/value pairs".
For the first dropdown I have no problem loading and recovering the data. I have that right.
The problem is in filling the second dropdown. An option of the first one is selected and from there I need to load the second dropdown.
The problem is in filling the second dropdown. An option of the first one is selected and from there I need to load the second dropdown.
Okay so do that what's the problem? If the first dropdown uses the id as the value, what's the issue?
In the read_data, where do I put the conditional so that it only shows me the ones related to the foreign key?
table2_id = {data:dropdown1}
Hi, I still can not fix it from the Dymanic Dropdown.
I do not know where to put the codicinal to show me what I need.
Try to do what you mention but it does not work for me.

[h2]Unknown column 'fkIdDepartamento={data.fkIdDepartamento}' in 'where clause'[/h2]
I do not know where to put the codicinal to show me what I need.
Try to do what you mention but it does not work for me.

[h2]Unknown column 'fkIdDepartamento={data.fkIdDepartamento}' in 'where clause'[/h2]
OK you're in an older version, so replace = with :
This topic is locked and no more replies can be posted.