drop down selects

Results 1 to 3 of 3

Thread: drop down selects

  1. #1
    Join Date
    Dec 1969

    Default drop down selects

    I have 2 drop down boxes on one page. the seconds data depends on what is selected in the first one. I am unsure of the code for this -Luke

  2. #2
    Join Date
    Dec 1969

    Default Look Here


  3. #3
    Join Date
    Dec 1969

    Default RE: drop down selects

    2 ways you can achieve this:<BR><BR><BR>First way:<BR>----------<BR>Using javascript (That is client side code)<BR>This approach is nice and fast. If and only If you dont have like 100 000 records in each combobox.<BR>The idea behind this approach is to load into a javascript array *all* the values from the first combobox and from the second combobox. Then create an *onchange* attribute in your first &#060;select&#062;...&#060;/select&#062; that will call a javascript function in which it will load the appropriate values into the second combobox<BR><BR><BR>Second way:<BR>-----------<BR>Using Server Side code liek VBscript for example.<BR>Load your first combobox with its value<BR>Then when the user selects an item from your &#060;select&#062;...&#060;/select&#062; create an *onchange* attribute that calls a javascript function that reloads your .asp page in wich you then retrieve the value selected from the first combobox and make a second query to your database to obtain the values to build your second combobox.<BR><BR>NOTE: This can be anoying to your user, the fact that it requires a refresh(trip back and forth)<BR><BR><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