Hi all,
i can’t figure how to do that :
I have a dropdown with an ajax option. When I select on of the rows, it give me back an option wich lead me to check/uncheck and enable/disable a checkbox. I can’t do the last part i.e update the checkbox in the ‘success’ function. My ajax return me the good result I can work on but i can’t go further…
can someone help me ?
My code :
<div class="row">
<?php echo $form->labelEx($model,'lesson_id'); ?>
<?php echo $form->dropDownList($model,'lesson_id', CHtml::listData($data, 'id', 'name'),
array('ajax' => array(
'type'=>'POST',
'url'=>CController::createUrl('lesson/isPrivate'),
'dataType'=>'json',
'data'=>array('idLesson'=>'js:this.value'),
'success'=>'function(isPrivate) {
if(isPrivate){
$("#Enchainement_private").checked = true; // doesn't work
} else {
$("#Enchainement_private").checked = false;
}
}',
)
)); ?>
<?php echo $form->error($model,'lesson_id'); ?>
<div class="row">
<?php echo $form->labelEx($model,'private'); ?>
<?php echo $form->checkBox($model,'private'); ?>
<?php echo $form->error($model,'private'); ?>
</div>
Thanks in advance