Disable chosen element with PrototypeJS not working in Firefox

156 Views Asked by At

I'm trying to disable a chosen element programatically and it doesn't work in Firefox but works in Chrome.

$$('select[multiple].chosen').each(function(element) { new Chosen(element); });

var MY_SELECT = $$('select[multiple].chosen')[0];

$('disable-button').on('click', 'button', function(event, element) {
    $('fruitsid').disabled=true;
    $('fruitsid').fire("chosen:updated");
});

Here is a JSFiddle: http://jsfiddle.net/y79rm2dk/2/

It seems the .fire doesn't work on disabled elements in Firefox?

1

There are 1 best solutions below

0
Geek Num 88 On

try using

$('fruitsid').writeAttribute('disabled',true);

instead of

$('fruitsid').disabled=true;