Yii CActiveForm with AJAX


Is there an easy way to implement AJAX into a form to create say a cascading drop down list where what you choose in the first list will limit what you can see in the next and so forth. I’m using the CActiveForms created by gii and I was wondering if I could keep using those.



Yes, you can keep on using

Add selectors(id,class) using htmlOptions to the select boxes so you can then use js normally and do what you want

something like

//php code


$form->dropDownList($model,'otherAttributeName',array(1=>'so yes ?',2=>'so no ?'),array('id'=>'myOtherSelect'));

//js code




	//or to select



something like that

I was actually thinking along the lines of populating the second list but I get the idea. Thanks!!