What I am trying to accomplish is to select an adtype_id and then use that value to select all the ad rates that have that adtype_id from the AdRates model:
TransactionsController File
public function actionGetadrates()
{
$data = AdRates::model()->findAll('adtype_id=:parent_id',
array(':parent_id'=>(int) $_POST['Transactions']['adtype_id']));
$data = CHtml::listData($data,'id','description');
foreach($data as $id => $value)
{
echo CHtml::tag('option',array('value' => $id),CHtml::encode($value),true);
}
}
View File:
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'transactions-form',
'enableAjaxValidation'=>false,
)); ?>
<div class="row">
<?php echo $form->labelEx($model,'Ad Type'); ?>
<?php echo $form->dropDownList($model,'adtype_id', CHtml::listData(AdTypes::model()->findAll(), 'id', 'description'), array('empty'=>'--please select--'),
array(
'ajax' => array(
'type'=>'POST', //request type
'url'=>CController::createUrl('Transactions/Getadrates'), //url to call.
'update'=>'#adrate_id', //selector to update
)));
?>
<?php echo $form->error($model,'adtype_id'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'adrate_id'); ?>
<?php echo $form->dropDownList($model,'adrate_id',array()); ?>
<?php echo $form->error($model,'adrate_id'); ?>
</div>
How can I troubleshoot this since it is an ajax call? Is there any way of testing to see if the action is even being executed or if the data is even being produced?

Help
















