Revision #14 has been created by Paul_Kish on Dec 3, 2014, 10:57:41 AM with the memo:
changed the second parameter of dropdownList() from '' to an empty array() since an empty string causes an error
« previous (#13) next (#15) »
Changes
Title
unchanged
Creating a dependent dropdown
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
AJAX, drop down list
Content
changed
[...]
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(), array(1=>'USA',2=>'France',3=>'Japan'),
array(
'ajax' => array(
'type'=>'POST', //request type
'url'=>CController::createUrl('currentController/dynamiccities'), //url to call.
//Style: CController::createUrl('currentController/methodToCall')[...]