just a quick one im looking to populate three drop down boxes to filter data and each one of them is going to affect the next.
what i want is for
Drop down 1 has company
once drop down 1 is selected the second drop down is populated with the branches for that company
once selected the third drop down is populated by the staff members for that company in that branch then when i press search it should pull the data for that 1 staff member. all of the information is in one table
the table i have is called “stafflist”
the columns are “company”, “branch” and “staffname” each staff member has an autonumber id field which i use as a lookup called “staffID”
Thank you for any help
Regards
Slowie
Lets take an easy example, This is a javascript solution. I’m using this and it works perfectly fine. This script work in case if you select a country it populates its corresponding cities in the second dropdown. You can take some idea and use this for your case where you can deal with three dropdowns respectively.
This is the country dropdown:
This is the region dropdown:
Now make a seperate file named crlist.js and include it in the page having above code like this:
code for crlist.js:
Now make a seperate file named crlist.php.
Code for crlist.php:
Now add following script on the page having dropdowns:
This is my own script, and i’ve assumed that you have created country and region tables. But you need to tweak the queries and above code according to your db structure. In your case you have to create tables for company, branches and employees.
Hope this helps.