3 Associated Select Boxes

Results 1 to 2 of 2

Thread: 3 Associated Select Boxes

  1. #1
    Join Date
    Dec 1969

    Default 3 Associated Select Boxes

    I need to have 3 select boxes populated from the database and they are all associated.. when I select something in sel1 it brings up another list box sel2 wtih items associated with the initial category, next when I pick something in sel2 it brings up another list box sel3 with items associated with sel2.<BR><BR>There was an earlier post about 2 associated select boxes but having 3 is a little tricky as I am finding out. Any code snippets, ideas etc. would be appreciated!

  2. #2
    Join Date
    Dec 1969

    Default Many ways

    to do this! <BR><BR>First approach <BR>-------------- <BR>What you need to do is *get all the possible* values for your two combobox. Create a javascript(if using javascript as your Client Side scripting) array. Have an "onchange" attribute inside your first combobox that calls a function. This function should load the second combobox. <BR>Search google.com for code example, you&#039;ll find plenty <BR><BR><BR>Second approach <BR>--------------- <BR>Build your first combobox. Have an onchange attribute that calls a function(javascript or VBscript client side). In that function make the page refresh this way you can retrieve what the user entered in the first combobox. Once this value retrieved, make a second SQL Query based on the user&#039;s selected choice an start building your second combobox, do the same thing on the second combobox(have it refresh when the user makes a selection). <BR><BR><BR>Third approach <BR>--------------- <BR>There is a third approach but that implies opening a new window. Instead of creating a combobox, add a &#060;textbox&#062; and a &#060;button&#062;. When the button is clicked, open a new window with a &#060;listbox&#062;. Let the user chose a value. Automatically close that new window when the user choses an item. Have another &#060;textbox&#062; and a &#060;button&#062; which represents your second combobox. When the button is clicked, bring with you(into the new window) the value from whitin the first &#060;textbox&#062;. Make another query to fill in the list and the same goes for your third &#060;textbox&#062;. <BR><BR><BR>Again, google.com has many examples <BR>Hope this helps! <BR>Sincerely <BR><BR>Vlince

Posting Permissions

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