PHP - Forms & Drop Down boxes help

Associate
Joined
14 Dec 2003
Posts
2,149
Location
Malvern
Hi all,

Little while since i've done any PHP but am needing to create a couple of pages for a project.

Basically what I want to do is to have 2/3 drop down boxes on a page which are all populated from entries in 2/3 different tables.

When a value in the first drop down box is selected, it'll pull the relevant fields from the next table and put them into the next drop down box and so on.

Possibly a little easier to explain in context. Drop down 1 will select an Office, once selected the applicable buildings for that office are available in Drop down 2. From those options, once a selection is made, the applicable floors for that building are shown in drop down 3.

Hopefully someone can understand that and point me in the right direction as i've never really looked at nested drop-downs etc.

Cheers :)

Andy
 
at the moment its 4 different tables, sites / buildings / floors / ports

Sites - siteID, siteName
Buildings - buildingID, siteID, buildingName
Floors - floorID, buildingID, floorName
Ports - port ID, floorID ......lots more detailed fields

eventually all the relevant info in the ports field will be displayed once the selections have been made from the sites/buildings and floors drop-down boxes.

It may be that that db structure needs re-working, its been a good few years since i covered DB design :p

Cheers
 
Back
Top Bottom