Combo Box to ListBox

Discussion in 'ASP General' started by Scott, Nov 21, 2003.

  1. Scott

    Scott Guest

    I have an ASP page which show's a Drop-Down Combo box, and
    a ListBox. My Combo Box is populated from a SQL Select
    Statement which shows User Groups. I want to populate my
    Listbox with all the names associated with that User Group
    selected from the Combo Box. I have a Select Statement
    that does this already also.

    However, I need to pass the Selected item chosen in the
    Combo Box with my SQL statement so I can get the correct
    list of names returned. The ASP page tries to run both
    Select statements, but errors when it reaches the second
    select statement since the parameter hasn't been filled
    yet, because the page hasn't given me a chance to chose an
    item from the Combo Box.

    Does anyone know how I can accomplish this?

    Currently, we are NOT using ASP.Net.
     
    Scott, Nov 21, 2003
    #1
    1. Advertising

  2. Scott

    Ray at Guest

    To do this, you need to either load all of the possible information in the
    page and then use client-side script to change the second SELECT, or make it
    a two step process where the user makes his first selection, the another
    trip is made to the server (by submitting the data, or using client side
    code to reload the page, etc.) and the server will then have that info it
    needs for the second query.

    See here for links to samples. http://www.aspfaq.com/2270

    Ray at home

    "Scott" <> wrote in message
    news:0b7701c3afca$77775630$...
    > I have an ASP page which show's a Drop-Down Combo box, and
    > a ListBox. My Combo Box is populated from a SQL Select
    > Statement which shows User Groups. I want to populate my
    > Listbox with all the names associated with that User Group
    > selected from the Combo Box. I have a Select Statement
    > that does this already also.
    >
    > However, I need to pass the Selected item chosen in the
    > Combo Box with my SQL statement so I can get the correct
    > list of names returned. The ASP page tries to run both
    > Select statements, but errors when it reaches the second
    > select statement since the parameter hasn't been filled
    > yet, because the page hasn't given me a chance to chose an
    > item from the Combo Box.
    >
    > Does anyone know how I can accomplish this?
    >
    > Currently, we are NOT using ASP.Net.
    >
     
    Ray at, Nov 21, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QW5nZWw=?=

    COMBO BOX INSTEAD OF DROP DOWN BOX

    =?Utf-8?B?QW5nZWw=?=, Jun 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    628
    Ken Cox [Microsoft MVP]
    Jun 29, 2004
  2. Adrian
    Replies:
    1
    Views:
    235
    Bullschmidt
    Feb 18, 2004
  3. dthmtlgod

    Fill Combo Box based on another Combo Box

    dthmtlgod, Nov 16, 2005, in forum: ASP General
    Replies:
    1
    Views:
    605
    Bob Barrows [MVP]
    Nov 16, 2005
  4. Mike

    Combo Box and text box

    Mike, Sep 24, 2003, in forum: Javascript
    Replies:
    2
    Views:
    169
  5. SM
    Replies:
    2
    Views:
    381
Loading...

Share This Page