I am trying to create a dropdown multiple select list using the
jQuery UI MultiSelect Widget and populating the option list with an ajax call.
The MultiSelect works great by itself but my attempt to bring in the options with Ajax results in no select options being shown.
For the ajax I am using the jquery.selectboxes.js plugin and the code looks like this:
- $('#example').multiselect({selectedList: 4}) // 0-based index;
$('#example').ajaxAddOption("selectbox.php"); - $('#example').multiselect('refresh');
That creates a blank multiselect dropdown. I have tried doing the ajax call first. Nothing. (the ajaxAddOptions works fine by itself.). The addoptions calls the php script which does its stuff and returns a jSon file with the data for the select options items.
I think my questions are:
1. Are the two plugins probably incompatible?
2. If compatible, what is the secret to make them work?
3. If incompatible, is there some other way (plugin or not) to populate the multiselect drop-down with the options using Ajax?
Thanks.
Bill