PDA

Click to See Complete Forum and Search --> : Mutiple selected listbox


Mark_Meng
Jun 19th, 2001, 08:17 AM
I have a multiple select Listbox, I wrote a javascript try to catch those Choice I made, but it does not work.
while (i <= document.myform.lstassignee.count)
{
x=document.myForm
if (x.lstassignee.options[i].selected) {
txt=x.lstAssignee.options[i].text + " " + txt
}
i++
}
Could somebody help??? Thanks very much

CiberTHuG
Jun 19th, 2001, 10:51 AM
*grumblegrumble*

Use the code tags.

What kind of error are you getting, or what is var txt being set to?

Also, text and value are two seperate properties. Make sure you are asking for the correct one.

Also, JavaScript is case-sensitive.

And lastly POST JAVASCRIPT QUESTIONS TO THE JAVASCRIPT FORUM!.

parkes
Jun 20th, 2001, 05:22 AM
I can do it through ASP so this may help.


sSelectedItems = Request.form("listboxname")
arrSelectedItems = Split(sSelectedItems, ", ", -1, 1)
For i = LBound(arrSelectedItems) To UBound(arrSelectedItems)
'do what ever you want from here
response.write arrSelectedItems(i)
End if
Next