Dynamic form view

Im developing a facility management system where a in the form view of my maintenance request i pick the building, floorNo & room.

i have the following tables and models

Building

-BuildingID

-BuildingName

-Floors(Enum Data type eg (‘ground’,‘1’,‘2’)

-Rooms (Enum Data type as well)

Maintenancerequest

-requestID


-BuildingID (FK)


-floor


-room


-Description

i want to be able to populate a dropdownlist on the form view with floors and rooms depending on the BuildingID chosen from the Building table rather than inputting the floor and room numbers manually

Kindly assist

http://www.yiiframework.com/wiki/24/