Page 1 of 1

populating combo boxes from database

Posted: Thu Jul 28, 2005 4:44 am
by stocktest
I am new to php.i have to combo boxes namely combo1 and combo2.
The values of combo2 has to be populated dynamically from database based on the value selected in combo1.

I want to know how to achieve the above scenario.

Posted: Thu Jul 28, 2005 5:00 am
by shiznatix
that sounds like you should load all the lists in and then use javascript to put whichever list you want into combo2 based on the selection in combo1. i dont think you want to use php for this unless you want them to submit the data every time they change the selection in combo1

Posted: Thu Jul 28, 2005 5:06 am
by harrisonad
as what he said, php is server side. But, if you have to change the contents of your combobox 2 instantly, use javascript.
look at this
viewtopic.php?t=29084