|
-
Jun 19th, 2001, 08:17 AM
#1
Thread Starter
Lively Member
Mutiple selected listbox
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
-
Jun 19th, 2001, 10:51 AM
#2
Frenzied Member
*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!.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jun 20th, 2001, 05:22 AM
#3
Hyperactive Member
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
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|