Cascading Dropdown Element - Based on multiple fields

Tessa

Member
Hello.

I have a Year table, a Brand table, and a Model table.

Right now, if you select a Year, the Models will filter (each year has many models).

But, then you see all the brands!

Is it possible to select a Brand and the Models will filter? So the models are only showing based on your brand and year selection?

This is for a form :)

<Select Year> (databasejoin element)
<Select Brand> (databasejoin element)
<Select Model> (cascading dropdown) (Model table has year_id, brand_id, model fields)


Thanks in advance :)
 
Have you tried playing around with the WHERE filter on the Model? You should be able to use placeholders, to match the "other" key you need to use. So probaby "{thistable}.year_id = {model___year_id}"

That should add an AND to the WHERE clause the SELECT uses, when building the model's CDD list.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top