Dependable drop down - update on page load

Hi guys,

I have used this tutorial to create a dependable drop-down where upon selection of an item type a second drop-down is populated with a sub-type corresponding to the item. My problem is that I want to enforce the ajax request to be executed upon page load and I honestly don’t know how to do that. Here’s my code:


echo $form->dropDownList($model, 'itemType', $model->getItemTypes(),

					  array('ajax' => array(





echo $form->dropDownList($model, 'itemSubtype', array());


the ajax part will only play when your first dropdownlist take a different value.

You must set the values directly in your form (like your controller dynamicItemSubtypes do).

Thank you, you are right, I have added everything I need via the controller.