Dynamically linking four listboxes from database (

Results 1 to 3 of 3

Thread: Dynamically linking four listboxes from database (

  1. #1
    Join Date
    Dec 1969

    Default Dynamically linking four listboxes from database (

    Hi I need to link four listboxes from a database each list being relatively large.<BR>table 1 has 39 entries so max 39 elements in list box 1<BR>table 2 has 69 entries so max of 6 elemnets in listbox 2<BR>table 3 has 190 entries so max of 7 elements in listbox 3<BR> table 4 has 1500 entries so max of 14 elements in listbox 4. <BR><BR>Now I know I could create arrays for every option in javascript but that could end up introducing a huge number of arrays or I could repost the data to the page but thats a sql call every time. The other problem is that their should be five rows of the above selection if not more each row being independent . Any help at all would be apreciated

  2. #2
    Rob Guest

    Default RE: Dynamically linking four listboxes from databa

    I am assuming changing the value of 1 box may change the valus of the others dynamically? If yes, then you need to use javascript. If not, use VB arrays. <BR><BR>You will need to select a count of the existing records and set the array size to that.<BR><BR>Rob

  3. #3
    Join Date
    Dec 1969

    Default RE: Dynamically linking four listboxes from databa

    I think you have analyzed the situation correctly. You can either create arrays of arrays in JavaScript and then do it all in client side script *or* you can have each new selection refresh the page with new lists from ASP code using SQL queries.<BR><BR>But maybe a compromise? How about doing the first two or three list boxes using the JS scheme and then using SQL for the last list, since it will be selecting from so many entries?<BR><BR>Why do you say "so max of 6 elemnets in listbox 2"? I don&#039t understand the word "so" there. "so" implies that the 69 table entries somehow cause the max of 6 elements. Are you just using the word wrong? Do you simply mean "69 values, but no more than 6 elements at a time?"<BR><BR>If that is what you mean for tables 2 and 3, then I think the "hybrid" idea has merit. Only use a separate ASP "round trip" to handle table 4.<BR><BR>To see a demo of how I handled two tables with a "round trip", go to http://www.ClearviewDesign.com/NEWBIE and see the "categories" demo (I think that&#039s what I called it).<BR><BR>If you need help getting the JS-with-arrays code right, check out http://www.LearnASP.com and search for "dynamic list boxes" or something along those lines. Charles has several pages on the topic on his site, as I recall.<BR><BR><BR>

Posting Permissions

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