Results 1 to 3 of 3

Thread: Mutiple selected listbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Springfield
    Posts
    120

    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
    MM

  2. #2
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    *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.

  3. #3
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303
    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
  •  



Click Here to Expand Forum to Full Width