3 drop down boxes

Discussion in 'ASP General' started by MasterChief, Oct 31, 2005.

  1. MasterChief

    MasterChief Guest

    I have 3 drop down boxes on the same page. Each one is being populated
    by a database. One is called Location, One is called Device and the
    other one is called Job Title. When the user selects something from one
    of the drop down boxes I would like it so it automatically calls the
    phonelist.asp and passes the variable. What is the best way to do it so
    I have 3 seperate drop-down boxes that just send their variables.
    Should I do one form that includes all boxes or one form for each
    drop-down box? How do I grab the variable from the drop-down box?
     
    MasterChief, Oct 31, 2005
    #1
    1. Advertising

  2. MasterChief wrote:
    > I have 3 drop down boxes on the same page. Each one is being populated
    > by a database. One is called Location, One is called Device and the
    > other one is called Job Title. When the user selects something from
    > one of the drop down boxes I would like it so it automatically calls
    > the phonelist.asp and passes the variable. What is the best way to do
    > it so I have 3 seperate drop-down boxes that just send their
    > variables. Should I do one form that includes all boxes or one form
    > for each drop-down box? How do I grab the variable from the drop-down
    > box?

    http://www.aspfaq.com/show.asp?id=2270
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 31, 2005
    #2
    1. Advertising

  3. MasterChief

    MasterChief Guest

    Sorry I probably didn't explain myself very well. I don't really want
    the drop-down boxes to be dependant on each other. I have Three boxes
    named Location, Device and Job Title. When the user choses something
    from say the Location list I want onChange to call the phonelist.asp
    and just send the Location variable that I chose. If the user chooses
    something from the Device list I want it to call phonelist.asp and only
    send the Device that the user chose. I just don't understand the best
    way to implement it and also how to have phonelist check against the
    Device sent if Device is sent or Location if Location is sent.
     
    MasterChief, Nov 1, 2005
    #3
  4. MasterChief wrote:
    > Sorry I probably didn't explain myself very well. I don't really want
    > the drop-down boxes to be dependant on each other. I have Three boxes
    > named Location, Device and Job Title. When the user choses something
    > from say the Location list I want onChange to call the phonelist.asp
    > and just send the Location variable that I chose. If the user chooses
    > something from the Device list I want it to call phonelist.asp and
    > only send the Device that the user chose. I just don't understand the
    > best way to implement it and also how to have phonelist check against
    > the Device sent if Device is sent or Location if Location is sent..


    You have to post to a page to enable this to happen. If you don't want to
    submit your page every time the dropdown selection changes, you can use
    XMLHTTP to submit to a server-side page from client-side code. Do a google
    for that term and followup in a client-side scripting newsgroup such as
    ..scripting.jscript
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Nov 1, 2005
    #4
  5. MasterChief

    Larry Bud Guest

    MasterChief wrote:
    > Sorry I probably didn't explain myself very well. I don't really want
    > the drop-down boxes to be dependant on each other. I have Three boxes
    > named Location, Device and Job Title. When the user choses something
    > from say the Location list I want onChange to call the phonelist.asp
    > and just send the Location variable that I chose. If the user chooses
    > something from the Device list I want it to call phonelist.asp and only
    > send the Device that the user chose. I just don't understand the best
    > way to implement it and also how to have phonelist check against the
    > Device sent if Device is sent or Location if Location is sent.


    This is really a client side issue.

    Does it matter if the selection is in the URL, or do you require a post
    to your page? If it can be in the URL, just call a function such as

    function dochange( element, page){
    document.location.href=page + "?var=" + element.value;
    }

    and on the select control do an onchange:

    <select onchange="dochange(this, 'mypage.asp')">
    <option>....
    </select>

    So what you'll do is pass the page that you want to go to as the 2nd
    parameter.
     
    Larry Bud, Nov 1, 2005
    #5
  6. MasterChief

    Bullschmidt Guest

    Here's a little something I put together that may hopefully give you
    some ideas about how to construct a SQL statement with a variable number
    of criteria:

    Classic ASP Design Tips - Search Criteria on Multiple Fields
    http://www.bullschmidt.com/devtip-searchcriteria.asp

    Best regards,
    J. Paul Schmidt, Freelance Web and Database Developer
    http://www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

    <<
    Sorry I probably didn't explain myself very well. I don't really want
    the drop-down boxes to be dependant on each other. I have Three boxes
    named Location, Device and Job Title. When the user choses something
    from say the Location list I want onChange to call the phonelist.asp
    and just send the Location variable that I chose. If the user chooses
    something from the Device list I want it to call phonelist.asp and only
    send the Device that the user chose. I just don't understand the best
    way to implement it and also how to have phonelist check against the
    Device sent if Device is sent or Location if Location is sent.
    >>


    *** Sent via Developersdex http://www.developersdex.com ***
     
    Bullschmidt, Nov 2, 2005
    #6
    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. SirPoonga
    Replies:
    2
    Views:
    769
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,022
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    483
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    274
  5. Replies:
    3
    Views:
    291
Loading...

Share This Page