Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP: Data Binding 3 drop downs

Options
  • 18-02-2002 9:58am
    #1
    Registered Users 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 Posts: 761 ✭✭✭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