almousawy87
(almousawy87@yahoo.com)
July 9, 2011, 12:51pm
1
why when I use this line ->>>> echo $form->dropDownList($model,‘Province’, $serv4,
the code for dependent dropdownlist not work but when I use the following it’s work
->>>>>> echo CHtml::dropDownList(‘S_id’,’’, $serv4, but this can’t store in database .Why? only echo $form->drop… can store the item in data base
it’s not store to database
array(
‘ajax’ => array(
‘type’=>‘POST’,
‘url’=>CController::createUrl(‘FullTable/dynamiccities’),
‘update’=>’#prov_id ’,
)));
redguy
(Maciej Lizewski)
July 12, 2011, 2:44pm
2
does your model has ‘Province’ attribute (foreign key) or is it rather relation name?
according to API docs - this function takes:
CActiveFrom::dropDownList(CModel $model, string $attribute, array $data, array $htmlOptions)
where the other:
CHtml::dropDownList(string $name, string $select, array $data, array $htmlOptions)
mdomba
(Maurizio Domba Cerin)
July 13, 2011, 8:57am
3
NOTE: moved to proper sub-forum
ivica
(Ivica Nedeljkovic)
July 13, 2011, 9:19am
4
Check your generated dropdown id, if it is same in both cases(when you are using CActiveForm and model, it ads prefix {ModelName} to id of form element name, so you might need to modify update field id in ajax function).