Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

ASP: Data Binding 3 drop downs

  • 18-02-2002 08:58AM
    #1
    Registered Users, Registered Users 2 Posts: 2,894 ✭✭✭


    OK, I have 3 drop-down populated from three tables with relationships created programatically on the dataset. What I want, no need, to know is, what ASP/Javascript code can I use so that if I select an item from dd1, dd2 and dd3 are automatically re-populated with data directedly related to the selected index in dd1 ?? Would it be possible without having to post back to the form ?

    This is doing my head.

    Any help would be greatly appreciated.


Comments

  • Registered Users, Registered Users 2 Posts: 778 ✭✭✭Terminator


    The best thing to do is use a javascript jump menu. So on option 1 in dd1 you refresh to default.asp?dd1=1 and so on


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by TinCool
    OK, I have 3 drop-down populated from three tables with relationships created programatically on the dataset. What I want, no need, to know is, what ASP/Javascript code can I use so that if I select an item from dd1, dd2 and dd3 are automatically re-populated with data directedly related to the selected index in dd1 ?? Would it be possible without having to post back to the form ?
    I did this years ago, client side, using a polymorphic code approach (actually, when you think about it, all server side programming that outputs dynamically generated HTML is polymorphic code...).

    In short, you can change the contents of a dropdown list by storing your related dropdown data in arrays and repopulating the dropdowns using the SELECT's onchange event. You would generate the array declaration code dynamically from the database.

    I'm sorry I can't find any code for you, but it was a long time ago, as I said. The only other thing I remember at the time, was that NS had issues with it, and I had to tweak it somewhat.


Advertisement