Hi,
I encountered a little problem with dynamic dropdowns
<div class="row">
<?php echo $form->labelEx($model,'realm'); ?>
<?php echo $form->dropDownList($model,'realm', array('prompt'=>'Please select', '0'=>'Mithral', '1'=>'Anvien', '2'=>'Corelan'),
array(
'ajax' => array(
'type'=>'GET', //request type
'url'=>CController::createUrl('character/ajaxRace'), //url to call.
'update'=>'#'.CHtml::activeId($model,'race'), //selector to update
'data'=>array('realm'=>'js:this.value'),
))
); ?>
<?php echo $form->error($model,'realm'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'race'); ?>
<?php echo $form->dropDownList($model, 'race', array('prompt'=>CHtml::encode('Please select'))); ?>
<?php echo $form->error($model,'race'); ?>
</div>
Ok, so this is working great for creating a new Entry.
But if you want to update, the ajax request is only invoked when changing the value.
So how do I get him to make that ajax call when loading ?
Greetings