dynamic combo's

Results 1 to 4 of 4

Thread: dynamic combo's

  1. #1
    Join Date
    Dec 1969

    Default dynamic combo's

    Hi,<BR>I&#039ve one combo box with some values from database say item category(Fruits,Vegetables).<BR>I select Fruits<BR> Can anyone suggest me an method (without using frames) for populating the second combo items which gets populated with data(Grapes,oranges) which fall in item category fruits.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: dynamic combo's

    It can be done if you send do a alittle java.<BR>So when something is selected from the first Combo the form (wich the combos are in) is submited to the same asppage and you do a db-search based on the selection of the first combo.<BR>And then fill upp the second combo with the results.<BR><BR>1. On choise in first combo send the choise (Fruits)<BR>2. SELECT * FROM TheTable WHERE Category = &#039" & Fruits "&#039"<BR>3. Fill upp the second Combobox with the results<BR><BR>Hope it wuz helpfull.

  3. #3
    Tom Crowe Guest

    Default RE: dynamic combo's

    Your other option, if you have a relatively small data set, is to prepopulate javascript arrays with the various data subsets. For example, you could have a fruit array and a vegetable array that are populated by an ASP statement. When Fruit or vegetable is selected from the first combo box, you could reassign the secondary box&#039s values with the corresponding array. For large data sets this won&#039t be effective since you are really preloading all possible combinations when the page is first loaded, and a large dataset will slow the page down considerably.

  4. #4
    Alex Harrison Guest

    Default RE: dynamic combo's

    Is there a reason why you can&#039t fill up the first "onload" and then fill the second when "onchange" occurs on the first? I can get it to fire off new queries but both go blank when I try using the value of the first in the sql query of the second.<BR><BR>Cheers in advance,<BR><BR>Alex Harrison<BR>Petroweb Ltd<BR>(alex@petroweb.co.uk)<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