Javascript – Making Chosen Dropdown Read only (not disabled)


I'm looking to make a chosen dropdown menu read only, and I need to do this dynamically using a jQuery selector. If I set it to disabled using:


the value isn't POSTed but I need it to be.

I have tried


but this doesn't work.

I'm using Chosen v1.4.2 and jQuery v2.1.4.

Help appreciated! Thank you.

Best Solution

The best solution for me was such an ugly trick $("#dropdownDepartment").prop('disabled',true).trigger('chosen:updated').prop('disabled',false). So chosen is disabled but value from select is POSTed.