views:

15

answers:

2

Hello,

I have a form callled "Project", it contains a selectbox with the names of the companies , the other selectbox is hidden and is called "Staff" and is to be made visible and filled with the names and ids of users that are working for the selected company.

>>selectbox "Company" visible   |   >>selectbox "Staff" hidden
----------------------------------------------------------------------------
[Company microsoft]           |   [null]
[Company aol]                  |                
[Company google]                 |                      
[Company facebook]             |                        

--> onclik selectbox "Company" -> e.g. google

>>selectbox "Staff" visible
------------------------------
[Staff X of google]
[Staff Y of google]
[Staff Z of google]

in Html

<form id="ProjectAddForm">
<select id="ProjectCompany" multiple="multiple" onClick="makeStaffVisible">
    <option value="1">Microsoft</option>
    <option value="2">AOL</option>
    <option value="3">Google</option>
    <option value="4">facebook</option>
</select>
<select id="Staff" style="visibility: hidden">
    <option></option>
</select>

I just don't know how to realize that with cakephp. Thanks for any help.

+1  A: 

This will be easily done with jQuery plugin: jquerychained

Nik
A: 

I did exactly that here: http://stackoverflow.com/questions/3709633/jquery-imgareaselect-hide-show

I thoroughly recommend jQuery with Cake. It's very easy to implement and has all the javascript you'll ever need.

If you need more details about how to do this task after reading that link, let me know and I'll post some code.

Leo