Link to home
Start Free TrialLog in
Avatar of akali
akali

asked on

4 Dynamic Drop downs

I have 4 drop downs boxes that  I would like to populate based on the preceding drop down selection. Since the volume of data is large I would like to make a trip to the database each time a selection is made.
My criteria is Campus, building, floors and rooms.

Any help would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of mrichmon
mrichmon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrichmon
mrichmon

Oh you also have to have the queries at the top of the page defined for GetCampuses, GetBuildings, GetFloors, GetRooms

Like this:

<cfquery datasource="yourdsn" name="GetCampuses">
SELECT * FROM Campus
</cfquery>

<cfif IsDefined("Form.Campus")>
<cfquery datasource="yourdsn" name="GetBuildings">
SELECT * FROM Buildings WHERE CampusID = #Form.Campus#
</cfquery>
</cfif>

<cfif IsDefined("Form.Building")>
<cfquery datasource="yourdsn" name="GetFloors">
SELECT * FROM Floors WHERE BuildingID = #Form.Building#
</cfquery>
</cfif>

<cfif IsDefined("Form.Floor")>
<cfquery datasource="yourdsn" name="GetRooms">
SELECT * FROM ROoms WHERE FloorID= #Form.Floor#
</cfquery>
</cfif>