Manipulating Combo Boxes

Results 1 to 2 of 2

Thread: Manipulating Combo Boxes

  1. #1
    Join Date
    Dec 1969

    Default Manipulating Combo Boxes

    I have 2 combo boxes on a page, what I&#039;m trying to do is to manipulate the 2nd combo box base on what the user chooses from the first combo box. For example if a user chooses a car make from the first combo box, I want to show all the available models for that make on the 2nd combo box. And also is it possible to do this without having to reload the page?<BR><BR>thanks in advance<BR>Carlos

  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 for code example, you&#039;ll find plenty<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 funciton 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.<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. Now you also 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.<BR><BR><BR>Again, 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