Revision #7 has been created by Michel Kogan on Sep 12, 2011, 7:27:42 PM with the memo:
change ajax to AJAX
« previous (#6) next (#8) »
Changes
Title
unchanged
Creating a dependent dropdown
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
AJAX
Content
changed
Often you'll need a form with two dropdowns, and one dropdown's values will be dependent on the value of the other dropdown. Using Yii's built-in
ajaxAJAX functionality you can create such a dropdown. Below will be demonstrated how you can achieve this.
First the view with the form. We'll show a form that shows countries and dependent of the country selected will show cities.
```php
echo CHtml::dropDownList('country_id','', array(1=>'USA',2=>'France',3=>'Japan'),[...]