hi guys need your help again i’m trying to make some dependant dropdownlists but the issue is that it is showing to me php 500 error and do not know why or how to solve it… any assistance will be very much aprecciated…
this is the function to look for the related value in the tables
public function actionSelectId()
{
$idOperationGroup = $_POST['Name']['Id'];
$list= Unit::model()->findAll('OperationGroupId = :idOperationGroup', array(':idOperationGroup'=>$idOperationGroup));
$list = CHtml::listdata($list,'Id','Name');
foreach($list as $valor => $Name){
echo CHtml::tag('option',array('value'=>$valor),CHtml::encode($Name),true);
}
}
this code is in my view…
<div class="row">
<?php echo $form->labelEx($model,'Name'); ?>
<?php echo $form->dropDownList($model,'Id',
CHtml::listData(OperationGroup::model()->findAll(),'Id','Name'),
array(
'ajax'=>array(
'type'=>'POST',
'url'=>CController::createUrl('Tire/SelectId'),
//'update'=>'#'.CHtml::activeId($model,'Unit'),
),'prompt'=>'Seleccione'
)
); ?>
<?php echo $form->error($model,'Name'); ?>
</div>