Urgent Listbox to listbox by using javascript
-
I have two listboxes ,one of the listbox data is populate in database. And I have two buttons Add and Remove. Once I click the add the button , the selected items is populated in another list box by using Javascript. Similarly Remove also. Give the javascript code or suitable link for the above scenrio
-
I have two listboxes ,one of the listbox data is populate in database. And I have two buttons Add and Remove. Once I click the add the button , the selected items is populated in another list box by using Javascript. Similarly Remove also. Give the javascript code or suitable link for the above scenrio
Use the Following code: function f_optionMove(s_from, s_to) { var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to);//test_form.elements[s_from],e_to = document.forms['test_form'].elements[s_to]; if (!e_from.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); if (!e_to.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); var n_moved = 0; for (var i = 0; i < e_from.options.length; i++) { if (e_from.options[i].selected) { var name = e_from.options[i].text; var ID = e_from.options[i].value; e_from.options[i] = null; e_to.options[e_to.options.length] = new Option (name,ID); n_moved++; } } if (n_moved) e_from.options.length = e_from.options.length; else alert("You haven't selected any options"); } function f_optionMoveAll(s_from, s_to) { var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to); if (!e_from.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); if (!e_to.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); var cntDesc = e_from.options.length; var cntSource = e_to.options.length; for (var i = 0; i < cntDesc; i++) { var name = e_from.options[i].text; var ID = e_from.options[i].value; e_to.options[cntSource] = new Option (name,ID); cntSource++; } e_from.options.length = 0; } < table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
-
Use the Following code: function f_optionMove(s_from, s_to) { var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to);//test_form.elements[s_from],e_to = document.forms['test_form'].elements[s_to]; if (!e_from.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); if (!e_to.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); var n_moved = 0; for (var i = 0; i < e_from.options.length; i++) { if (e_from.options[i].selected) { var name = e_from.options[i].text; var ID = e_from.options[i].value; e_from.options[i] = null; e_to.options[e_to.options.length] = new Option (name,ID); n_moved++; } } if (n_moved) e_from.options.length = e_from.options.length; else alert("You haven't selected any options"); } function f_optionMoveAll(s_from, s_to) { var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to); if (!e_from.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); if (!e_to.name) return alert ("Error: selectbox with name '" + s_from + "' can't be found."); var cntDesc = e_from.options.length; var cntSource = e_to.options.length; for (var i = 0; i < cntDesc; i++) { var name = e_from.options[i].text; var ID = e_from.options[i].value; e_to.options[cntSource] = new Option (name,ID); cntSource++; } e_from.options.length = 0; } < table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
how can i store the values in the 'lstdestination' listbox. Suppose i select the three values from the lstsource. How can i reterive the three values in server side ie., Code behind.
-
how can i store the values in the 'lstdestination' listbox. Suppose i select the three values from the lstsource. How can i reterive the three values in server side ie., Code behind.
What is the exact functionality u want, please explain that so that I can give u the proper suggestion.
-
I have two listboxes ,one of the listbox data is populate in database. And I have two buttons Add and Remove. Once I click the add the button , the selected items is populated in another list box by using Javascript. Similarly Remove also. Give the javascript code or suitable link for the above scenrio
hi found this in codeproject http://www.codeproject.com/useritems/Listbox\_or\_combo\_box.asp
winnie