Changing selection in a select with the Chosen plugin

The Solution to Changing selection in a select with the Chosen plugin is


From the "Updating Chosen Dynamically" section in the docs: You need to trigger the 'chosen:updated' event on the field

$(document).ready(function() {

    $('select').chosen();

    $('button').click(function() {
        $('select').val(2);
        $('select').trigger("chosen:updated");
    });

});

NOTE: versions prior to 1.0 used the following:

$('select').trigger("liszt:updated");

~ Answered on 2012-01-23 23:40:34


Most Viewed Questions: