Select all on cascading dropdown as checkbox list

FilMar

Member
Is there a (more or less) easy way to have a 'select all' button or so on a dropdown rendered as checkbox list?

I have a form where most of the time all or most of the options shown shall be selected so it would be nice to have the possibility to select them all at once.

Or if there is an easy way to select them all by default, that can be a solution also (via Eval options?).

Many thanks in advance,

Greetings,

Filip
 
JavaScript:
//Check All options after form is loaded (valid only for databasejoin element).
var all_checkBoxes = jQuery('#your_elem___name').find('.fabrikinput');
all_checkBoxes.prop("checked", !all_checkBoxes.prop("checked"));
JavaScript:
//Check/Uncheck All options after click element databasejoin label.
var elem = jQuery('#your_elem___name').closest('.fabrikElementContainer');
jQuery(elem).on('click','.fabrikLabel', function(){
   var all_checkBoxes = jQuery(elem).find('.fabrikinput');
    all_checkBoxes.prop("checked", !all_checkBoxes.prop("checked"));
})
 
Last edited:
Great,

Works like a charm! I used the second version as the dropdown is a cascading dropdown who is not filled in at form load.

Thank you very much

Greetings,

Filip
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top