javascript - Unable to Move the List of values from Right Combo bx to Left Combo bx (Multiple List of values) -


function listbox_moveacross(sourceid, destid) {     var src = document.getelementbyid(sourceid);     var dest = document.getelementbyid(destid);     var errcount = 0;     (var count = 0; count < src.options.length; count++) {         if (src.options[count].selected == true) {             var option = src.options[count];             var newoption = document.createelement("option");             newoption.value = option.value;             newoption.text = option.text;             newoption.selected = true;             try {                 dest.add(newoption, null); // standard                 src.remove(count, null);             } catch (error) {                 dest.add(newoption); // ie                          src.remove(count);             }             count--;             errcount++;         }     }     if (errcount == 0) {         alert("no element selected or have no element move");     } } 

hi can body on javascript given code moving list of values right left , left user can select multiple values in given list in case unable move list of values right left working fine left right

try removing count--; code have feeling preventing loop moving onto next iteration if finds selected item in list.

seems work fine me:

http://jsfiddle.net/xbdkg/


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -