Problem with updating dependent DropDownList

Hi All

I have created a dependent DropDownList using Now the problem I am facing is When I have to update the form then I have to select the values of all drop down list again. Since there are around 5-6 dependent drop down list so it is a little problematic. Is there any way with which i don’t have to select it again and again while updating a form.


Hi All

Its been a while and still no reply.

Is there anyone who can help me out with this problem???



Only an idea, I didn’t test it.

Did you try jquery-cascade?


Where are the key, values are from?

If they are coded at Model, you may follow this:


class Member extends CActiveRecord


    const GENDER_MALE=1;

    const GENDER_FEMALE=2;

    public function getGenderOptions()


        return array(





    public function getGenderText()



        return isset($genderOptions[$this->gender]) ? $genderOptions[$this->gender] : "unknown ({$this->gender})";




        <div class="row">

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

                <?php echo $form->dropDownList($model,'gender',$model->getGenderOptions()); ?>  

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








        <b><?php echo CHtml::encode($data->getAttributeLabel('gender')); ?>:</b>

        <?php echo CHtml::encode($data->getGenderText()); ?>

        <br />

If you need the key/value from another table, refer the book Agile Web Application Development with Yii 1.1 and PHP5. It helped me.