Conditional category select elements.
I have a search form with several parent categories in a select element and would like a conditional select element to show up based on the parent selection.
For example, I select Fire and Rescue. Submit. Now underneath that select element i'd like to see another select element with its child categories (1st responders, trucks, etc...)
<select name="category[]">
<option value=''>-- Select Industry --</option>
{exp:channel:categories channel="product" style="linear" category_group="2" parent_only="yes"}
<option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
{category_name} - {category_id}
</option>
{/exp:channel:categories}
</select>
and want to add something like this underneath:
{if category_id="x"}
{low code here}
{/if}
Replies
Low 24 Feb 2013 10:34
You could use the same IN syntax, for example:
...where 10 is the category id to check.