Search code examples
phpjquerycodeignitermulti-selectjquery-ui-multiselect

How to add extra options programatically in multiselect


How to add extra options programatically? I am using a jquery multiselect check this Already try a solution like this:

$('#public-methods').multiSelect('addOption', { value: 42, text: 'test 42', index: 0 });

but i get a error message in console like

"Method addOption does not exist on jquery.multiSelect"

How to solve these problem?

Refe:check this

enter image description here


Solution

  • Can you provide a link to the page your working on? When I try to add options to the example multiSelect on the home page of the page you provided using the console I can easily add options and it works fine.

    $('#aloha').multiSelect('addOption', { value: 'test', 'text': 'wohoo'});
    

    Perhaps you can try this in your console on the element your trying to modify?