event handling

i have created two dropdowns in my view without any database.when i select a value in one dropdown other dropdowns value must populate.how to do that event handling in yii.please help me.

Since there is no db, then if I am not wrong, you must use javascript(jquery) in this case.

something like :


    $('#select-2').append('<option value="0">option1</option>');

    $('#select-2').append('<option value="1">option2</option>');




how should we give names for the dropdowns that we have in our form?

the name should be given when you write the code in view fileā€¦


echo CHtml::dropDownList('select-1', 0, array());

echo CHtml::dropDownList('select-2', 0, array());