Difference between #6 and #7 of
Creating a dependent dropdown

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'),
[...]
83 2
92 followers
Viewed: 416 854 times
Version: 1.1
Category: Tutorials
Written by: dalip
Last updated by: Paul_Kish
Created on: Mar 23, 2009
Last updated: 9 years ago
Update Article

Revisions

View all history