Click to See Complete Forum and Search --> : selectbox - pls help....struggling....


suganya
08-18-2003, 03:08 PM
I have 8 listboxes on my form.....a pair of 4 and transferring values frm left to right listbox

I need to save the values of every right listbox separately (list2,list4,list6 adn list8) ....how do i get this?....

i wrote a piece of code but i'm stuck bcos i need to use the name of the each listbox to refer to which listbox was selected....how do i do this......

if i say, document.formName.selectboxName.selected, it says the object is null or undefined....

pls help me...
thanks

Khalid Ali
08-18-2003, 03:34 PM
this is how you can gt the selected value of a list box

var val = document.formName.listboxName.options[document.formName.listboxName.selectedIndex].value;

suganya
08-18-2003, 03:45 PM
i dont want the selected value from the listbox......when i am transferrring values from the left to the right i want to know which listbox is selected.....whether list1 or list3 or list5 or list7.....

i am actually using struts html:select tag and the name of the listboxes there go by the value in the property attribute of the html:select.....i want to know if a particular listbox itself is selected or not and not the value of the item within the lisbox..
i hope i am clear!...
thanks a bunch for your response....