Forums › Forums › Search & Filter Pro › dynamic dropdown rely on another dropdown
- This topic has 9 replies, 2 voices, and was last updated 9 years, 7 months ago by
Anonymous.
-
Anonymous(Private) July 28, 2016 at 8:19 am #52383
Is it possible to make dynamic dropdown that shows child taxonomy terms from selected parent taxonomy term on another dropdown?
There two dropdowns one for parents and one for children.
When select parent, second dropdown shows only children of parent selected.Similar to this topic.
https://support.searchandfilter.com/forums/topic/ability-to-dynamically-populate-second-filter-dropdown-upon-selection-of-first/Trevor(Private) July 28, 2016 at 10:42 am #52411Generally, having one taxonomy with parent and child terms is not a good idea. Instead, you should have two taxonomies (use CPT UI plugin to add taxonomies). Let me give an example. You have a general taxonomy called Category and in this you have States and Cities within them as children.
Instead, you should have two Custom Taxonomies, one called States and the other called Cities. Then, as long as you have auto count enabled, and hide empty values on the Cities taxonomy, as soon as you select the State, only the Cities from that state are visible.
-
AuthorPosts