Utilizing the chosen multiple selection feature, I have encountered an issue where selected options remain visible after being hidden and updated.
Here is the code snippet:
$("#ddlcodes").find("option[value ='" + codeValue + "']").hide();
$("#ddlcodes").trigger("chosen:updated");
Despite attempting to hide selected options upon adding them, some still remain visible while others are successfully hidden.
Below is the DOM HTML structure:
<select id="ddlcodes" class="form-control code-change" style="display: none;"><option value="488" style="display: none;">33210</option>
<option value="489" style="display: none;">33213</option>
<option value="487">33208</option>
<option value="492">33284</option>
<option value="486">33207</option>
<option value="490">33216</option>
<option value="496">75724</option>
Hidden values are not being removed from the dropdown list as intended. You can refer to the screenshot below for clarification:
https://i.sstatic.net/O4lBL.png
https://i.sstatic.net/Y7BU0.png
I am seeking a solution to completely remove these options from all instances. Any advice would be greatly appreciated. Thank you.