jquery - Geodan's DualListbox : how to populate selected box with data from ArrayList -


i writing mvc applicaiton dual list box, 1 side unselected testers. on selection of testers, saving data table. problem how bind saved data "selected" box , other list of users "unselected" box.

the data being fetched through json request , response array list cannot using selected in <option> tag inside <select> tag. please see below code.

how populate "selected" box data returned arraylist on json call.

<div id="dual-list-box" class="form-group row">   @*<select name="testers" id="emp" multiple="multiple" data-title="employees" data-source='@url.action("addtesterlookup")' data-value="index" data-text="name"></select>*@   <select id="emp" multiple="multiple" data-title="employees" name="name" value="@model.name" data-source='@url.action("addtesterlookup")' data-value="index" data-text="name"></select> </div> 
<script type="text/javascript">   $('select').duallistbox(); </script> 

i don't know if you're using js or php framework, should use javascript run ajax query when first select box it's changed.

that ajax should use value of first select box elements populate javascript in second select box.

check example: multiple html select , jquery ajax


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -