Search code examples
jquerybootstrap-multiselect

Bootstrap multi-select select all option value


I am using bootstrap-multiselect plugin.

jQuery

$("#country").multiselect({
    enableFiltering: true,
    includeSelectAllOption: true,
    numberDisplayed: 2,
    maxHeight: 400,
    buttonWidth: '100%',
    selectAllValue: '0'
});

when I select the select all option and submit the code i get an array of all other options in server side.But i am assigning the value 0 for the select all option which i am not getting in server side.How can i include the value 0 in the value array when i select the select all option.


Solution

  • As outlined in the Server Side Processing section of the documentation, the selectAllValue merely alters the value submitted. However, in order to correctly submit the select all option, you have to set the name of the select all option using selectAllName. Btw: when aiming to process the multiselect data server side, you should also use checkboxName.