I would like to use jquery to filter all selection fields on the form
For example: in the first selection window, if I select "show only 1", I want to filter out all the selection parameters in all the selection elements to hide any option where the value does not contain "_1". Only the product value with "_1" should appear.
If "--- Filter ---" is selected, the default value for all selection fields must be empty
Here is the HTML
<select id="selectlist" name="selectlist" >
<option value="">---Filter---</option>
<option value="1">show only 1</option>
<option value="2">show only 2</option>
<option value="3">show only 3</option>
</select>
<br><br>
homeware<select id="select1" name="select1">
<option value=""></option>
<option value="product_1">product 1</option>
<option value="product_2">product 2</option>
<option value="product_3">product 3</option>
</select>
<br>
electronics<select id="select2" name="select2">
<option value=""></option>
<option value="product_1">product 1</option>
<option value="product_2">product 2</option>
<option value="product_3">product 3</option>
</select>
<br>
kitchen<select id="select3" name="select3">
<option value=""></option>
<option value="product_1">product 1</option>
<option value="product_2">product 2</option>
<option value="product_3">product 3</option>
</select>
I would like to know how to use jQuery to achieve the above.
source
share