Dependable drop down - update on page load

Hi guys,

I have used this tutorial http://www.yiiframework.com/wiki/24 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:

view:




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

					  array('ajax' => array(

							'type'=>'POST',																

							'url'=>CController::createUrl('items/dynamicItemSubtypes'),							

							'update'=>'#FilterForm_itemSubtype',

   			)));

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



Hi,

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.