Forums

PHP

This topic is locked

Link 1st list to 2nd

Posted 07 Nov 2006 04:08:14
1
has voted
07 Nov 2006 04:08:14 david knaq posted:
I am trying to dynamically populate a list from mysql - DONE
the selected item in list 1 determines list 2's contents - CANT GET IT

I have found examples on the web where this is done in javascript and i can make it "kinda" work but i am wondering if there is an easy to populate list 1 from mysql and depending on the selection it will populate the second list.

here is a site that sells what i am trying to acomplish. I know someone knows how to help me do it myself.

www.webassist.com/professional/products/productdetails.asp?PID=1

thanks in advanced.

Replies

Replied 07 Nov 2006 10:40:58
07 Nov 2006 10:40:58 Roddy Dairion replied:
so like a dynamic drop down. then you can do it in javascript or php. i dunno how to in javascript. But in php its just creating a jump menu that will load an id this id will have a list of category which when passed in a url can load the list for the second dropdown.
Replied 10 Nov 2006 02:54:03
10 Nov 2006 02:54:03 david knaq replied:
Yes, I can load the values into the first list via mysql. However when the "id" is set from the first list it needs to populate the second list with values.

for instance:

List 1 holds [Drinks]
-Beer
-Wine
-Softdrinks

If the top level selection in -softdrinks then the second list should show
[Drinks]
-[Softdrinks]
-Sprite
-Dr Pepper
-Root Beer

The database holds the primary key so the linking should be no issue.
Replied 10 Nov 2006 03:07:26
10 Nov 2006 03:07:26 LorD ExoskeletoN replied:
I think it can be done by PHP by it'l load the entire page everytime you click the category but if you make use of AJAX or CSS then the entire page will remain and the necessary information will come out ...

good luck...

<div align=right>
Burn RUBBER Not SOUL

www.nasbikesphilippines.bravehost.com
<img src="www.motorcyclephilippines.com/forums/signaturepics/sigpic14460_2.gif" border=0></div id=right>
Replied 10 Nov 2006 03:14:59
10 Nov 2006 03:14:59 david knaq replied:
hmm.. I know nothing about AJAX so that rules out it, however CSS i can do. If the page has to refesh after the selection is made , and the refresh generates the new list that may be ok as well.
Replied 10 Nov 2006 03:37:00
10 Nov 2006 03:37:00 LorD ExoskeletoN replied:
yah its fine...but it will take time as the whole page refreshes...

good luck david!

<div align=right>
Burn RUBBER Not SOUL

www.nasbikesphilippines.bravehost.com
<img src="www.motorcyclephilippines.com/forums/signaturepics/sigpic14460_2.gif" border=0></div id=right>

Reply to this topic