Resetting Chosen JQuery dropdowns

50 views Asked by At

So I have multiple dropdowns which are dependent on each other. When the button is clicked, it will do something if each dropdown has a value to it and it will also clear out the options and regenerate the options for chosen-province. If the user misses a dropdown, it will prompt them the message until all the options are selected. However, after the dropdowns are reset, the dialog box will appear again even if i have selected all the options and if i miss one dropdown, the dialog box will appear multiple times.

The code can be found here: https://jsfiddle.net/Charan98/y61kns0d/3/

$('.chosen-region').empty()
$('.chosen-region').trigger("chosen:updated");
$('.chosen-sitestat').empty()
$('.chosen-sitestat').trigger("chosen:updated");
$('.chosen-province').empty()
$('.chosen-province').trigger("chosen:updated");
0

There are 0 answers