Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: two combo boxes

  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    two combo boxes

    hello,
    Im a newbie, my problem is to create two combo whrere the values in the second depend from first, and both combo are loaded by datas of database sql server, to load the first is easy, so on event onchange Id like to load second combo by a query from db.
    Any ideas?

    regards ENzo

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    This is a fairly common request. In fact, a cursory Google for "ASP+populate+second+dropdown" would have given you a whole load of possible solutions. Or the same search on this forum gives you several threads where the issue is discussed in detail. But basically, you can submit your form to itself and requery the data each time, you can load the whole lot into client-side arrays, or you can do it the bling way with Ajax. You seem happy with getting data out of a database, and you're clearly familiar with enough client-side scripting: which aspect of populating the second drop-down are you having difficulty with?

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    tks, for reply, so really im working with asp.net so far, its first time with asp, anyway my first difficult its to pass the parameter selected in first combo to stored procedure for second combo, i dont know how i can get it and pass to second combo...

    thks Enzo

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you're using ASP.NET I would suggest you to use Cascading DropDown control in Ajax.Net.

  • #5
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    unfortunately now I must use asp , anyway ive had a good help from link suggested from you, thanks

    ENzo

  • #6
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is an example of a Pure ASP/HTML dependent dropdown
    http://forums.aspfree.com/code-bank-...wn-137839.html

    It also include Ajax code so that if javascript is enabled the menu is dynamic (onchange)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •