We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

dynamically populate/filter search parameter fields

How Do I?

fensterbaby's avatar
fensterbaby
261 posts
9 years ago
fensterbaby's avatar fensterbaby

Have searched around but can’ find an answer to this. I know it’s common feature need.

I want to make a search widget where you select the first field, say Make, and then the second field Model is populated by possible values of Model for that Make.

So if you select Ford then only Ford models appear in the Model selector.

I see two ways in general this could work.

Possible values for all fields are predetermined. The Ford make field is related to values for all possible Ford models

or a more dynamic solution… after you select the first field value then the additional fields are populated by values that have been entered in channel entries.

ex: If I select Ford in the Make fields then the Model field is populated not by all possible Ford models but by Ford models for which there are channel entries.

So if there are no Ford entries that have a Model value of Focus then Focus does not appear in the drop down selector for models.

Is there an addon with this sort of functionality or are we talking javascripting?

I am looking for the least technical solution possible as custom JS coding is beyond me.

Thanks for any ideas or points in the right direction.

THanks!

Greg

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil

I don’t have a ready-made solution or plugin for you, but I’d probably attempt this with (parent)categories and some AJAX magic.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
9 years ago
Kevin Cupp's avatar Kevin Cupp

Like Ingmar, also don’t know of a ready-made add-on. Yes it’s a common feature but I’d imagine each solution is custom because the mechanics are quite simple and the data models and rules for population vary. For this, you’d basically listen for a change event on a select box, then fire an AJAX request to get Models for the selected Make, then populate the other select box with the result set. Might be a good opportunity to dive into some custom AJAX development.

       
tbritton's avatar
tbritton
714 posts
8 years ago
tbritton's avatar tbritton

I have done this to show counties and then towns in that county for a restaurants listing page. It was rather easy, actually!

http://ruralintelligence.com/food_section/food_restaurant_listing

If you still need this, let me know. Sorry I only just noticed this 8 months later!

Terry

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.