Dynamic Drop down - a drop down dependent on another

I am new to Cakephp and also not have much idea about php, ajax etc. I am trying to build a dependent drop down and has spent more than a week. Tried google search and implemented few examples after are not working. My requirement is like on selection of State, District drop down showed refresh. Can any one help me step by step to achieve this functionality. I am sorry if it seems to be very basic and might have been answered many times in past, but unfortunately i could not reach there.

Please see http://sandbox.dereuromark.de/sandbox/ajax-examples and “Chained Dropdowns” examples. Source code is linked there.

Thanks Mark for the reply. I tried but got confused in between. So do you want me to go through some tutorial before trying the source codes. As because i could not figure out in which file what needs to be edited. Please let me know.