Dependent Dropdown


I want to create a dependent dropdown using CForm.

How to use ajax in CFormElement?????

Thank You In advance


hope this helps

write something like this in your _form.php

	<div class="row">

		<?php echo $form->labelEx($model,'provider_id'); ?>

        <?php echo $form->dropDownList($model,'provider_id',array(null=>'Please select') + CHtml::listData($provider, 'id', 'name')); ?>


		<?php echo $form->error($model,'provider_id'); ?>


in your create.php

<?php echo $this->renderPartial('_form', array('model'=>$model,'provider' =>$provider)); ?>


Maybe you can use the extension cascadedropdown or take a look at the source.