Dependent Drop Down List Using Ajax

Hi Guys,

I have struggled with this problem for a couple of days and I just seem to get it right. I am trying to create one drop down list that is dependent on another. I have followed through some of the examples given in a google search but they don’t seem to work either.

Here is the code in my view file

<?php

 &#036;form=&#036;this-&gt;beginWidget('CActiveForm', array(


    'id'=&gt;'play_form2',


    'enableAjaxValidation'=&gt;true,

));

        &#036;genClass = makesModels::model();


        &#036;criteria = &quot;ParentID = 0&quot;;


        &#036;genData = Chtml::listData(&#036;genClass-&gt;findAll(&#036;criteria), 'ID', 'Description');


        &#036;options = array(


            'id' =&gt; 'ParentID',


            'ajax' =&gt; array('type'=&gt;'POST'


                            , 'url'=&gt;DealsController::createUrl('deals/dynamicModels')


                            , 'update'=&gt;'#'.CHtml::activeId(&#036;model, 'ModelID')


            )


        );


        echo CHtml::dropDownList('ID', '', &#036;genData, &#036;options);





        echo &#036;form-&gt;dropDownList(&#036;model, 'ModelID', array());





 &#036;this-&gt;endWidget(); 

?>

And Controller

  public function actionDynamicmodels() {





    &#036;param_parent =&#036;_POST['ParentID'];


    &#036;criteria = &quot;ParentID=&#036;param_parent&quot;;


    &#036;data = makesModels::model()-&gt;findAll();


    &#036;data = CHtml::listData(&#036;data, 'ID', 'Description');


    foreach(&#036;data as &#036;value) {


        echo CHtml::tag('option',array('value'=&gt;&#036;value-&gt;ID,CHtml::encode(&#036;value-&gt;Description) , true) );





    }

}

Any pointers are greatly appreciated