Howdy,
Using 1.1.1, and just went through the dependant dropdown tutorial in the cookbook here.
The tutorial uses CHtml::dropDownList whilst my views use CHtml::activeDropDownList (generated by default crud), so I assume this is why I can’t get it to work. I can’t find what would cause it to behave differently though.
Here is my dropdown (that should cause the ajax routine to update it):
echo CHtml::activeDropDownList($model, 'lang', CHtml::listData(Language::model()->findAll(), 'id', 'lang' ),
array(
'prompt'=>'Select Language...',
'ajax' => array(
'type'=>'POST',
'url'=>'dynamicroots',
'update'=>'#Word_root',
)));
Have also tried generating the url with CController::urlCreate() as suggested in the comments of the tutorial, but to no avail.
And here is my handler in my controller:
public function actionDynamicroots() {
echo CHtml::tag('option', array('value'=>'0'), CHtml::encode('harf1'), true);
echo CHtml::tag('option', array('value'=>'1'), CHtml::encode('harf2'), true);
echo CHtml::tag('option', array('value'=>'2'), CHtml::encode('harf3'), true);
}
Any help is greatly appreciated.
P.S Not sure if this is relevant, but if I try to browse that url manually it gives a 403:
Error 403
You are not authorized to perform this action.