Jquery-ui retrieve selected buttons in a set (check box) - firefox problem

You can select the “selected” buttons in the jquery ui set of sets using checkboxes (to enable multitasking) with:

$('#format').buttonset(); $('#format').click(function() { var text = ""; $('#format').find('label[aria-pressed|="true"]').each(function() { text += $(this).attr("for") + "-"; }); $('#selected').html(text); }); 

This works fine in Chrome, IE, Safari, but this flag is not taken into account in Firefox. You can check this in jsFiddle .

+4
source share
3 answers

Try:

 $('label.ui-state-active') 

See my updated jsFiddle http://jsfiddle.net/qLWNd/

+4
source

Try using the bind function

 $('#format').bind("click",function() { var text = ""; $('#format').find('label[aria-pressed|="true"]').each(function() { text += $(this).attr("for") + "-"; }); $('#selected').html(text); }); 

or live plugin from jquery

0
source

FYI, from jquery-ui from 1.10.0 to 1.11.4 (last), the click () event does not work as expected for checkboxes buttonset in Firefox.

Try:

 $('#format').change(function () { var text = ""; $(this).children('label.ui-state-active').each(function () { text += $(this).attr("for") + "-"; }); $("#selected").html(text); }); 

See this jsFiddle http://jsfiddle.net/03ee1m60/2/

0
source

All Articles