Question

I have a chosen combobox (with multiples values).

I have 2 buttons: first has this function in order to add a value in the combobox

$('select option[value="13"]').attr('selected', 'selected')
$('select').trigger('chosen:updated');

Second button has this function in order to remove this value:

$('select option[value="13"]').removeAttr('selected')
$('select').trigger('chosen:updated');
  1. I call my page: everything is fine
  2. Click on first button: ok, the value is added
  3. Click second button: ok, the value is removed
  4. Click another time on first button: problem, the value is not added

You can see an example here: http://jsfiddle.net/pingoooo/7NWEd/1/

Can you tell me why the second time I click on the first button, the function doesn't work.

I use chosen version 1.0

Thanks

EDIT: seems that works on chrome but why not IE and FF

Was it helpful?

Solution

I received an answer on github wich answer perfectly my question:

https://github.com/harvesthq/chosen/issues/1732

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top