J
Joe Abou Jaoude
hi all,
I have 2 listboxes in my web page. one listbox has 5 items when the page
is loaded, the other one is empty. The user then add fields from the
filled listbox to the empty listbox. this is done successfully using
javascript.
when the page is submitted i want to check the items that the user added
to the listbox.
however i always get that the first listbox has 5 items and the second
listbox is empty. It's like the user changes wasn't submitted to the
server.
the 2 listboxes has the EnableViewState = true.
the javascript that i use to add items to the listbox is the following:
(i use the listbox.remove method and the new option () )
function AddItem() {
if(window.document.Form1.lstAll.selectedIndex == -1) return;
var item =
window.document.Form1.lstAll.options[window.document.Form1.lstAll.select
edIndex].text;
var i = Form1.lstSort.length;
Form1.lstSort.options = new Option(item, i);
window.document.Form1.lstAll.remove(window.document.Form1.lstAll.selecte
dIndex);
}
thanx
I have 2 listboxes in my web page. one listbox has 5 items when the page
is loaded, the other one is empty. The user then add fields from the
filled listbox to the empty listbox. this is done successfully using
javascript.
when the page is submitted i want to check the items that the user added
to the listbox.
however i always get that the first listbox has 5 items and the second
listbox is empty. It's like the user changes wasn't submitted to the
server.
the 2 listboxes has the EnableViewState = true.
the javascript that i use to add items to the listbox is the following:
(i use the listbox.remove method and the new option () )
function AddItem() {
if(window.document.Form1.lstAll.selectedIndex == -1) return;
var item =
window.document.Form1.lstAll.options[window.document.Form1.lstAll.select
edIndex].text;
var i = Form1.lstSort.length;
Form1.lstSort.options = new Option(item, i);
window.document.Form1.lstAll.remove(window.document.Form1.lstAll.selecte
dIndex);
}
thanx