Hi all,
I am trying to use the CJuiAutoComplete for both views create and update.
I wan’t to show the recommendator’s name and submit his id on create.
On update I’d like to show the recommendator’s name again by given id, but with the possibility to change the recommendator.
My code is the following:
echo $form->labelEx ($model,'recommendator_id');
echo $form->error ($model,'recommendator_id');
echo $form->hiddenField($model,'recommendator_id',array());
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'model' => $model,
'attribute' => 'recommendator',
'sourceUrl' => $this->createUrl('customer/getAutocompleteList'),
// additional javascript options for the autocomplete plugin
'options' => array(
'showAnim' => 'fold',
'select' => "js:function(event, ui) {
$('#Customer_recommendator_id').val(ui.item.id);
}"
),
'htmlOptions' => array(
'class' => 'autocompleteCustomer',
)
));
This works well for create but on update I get the following error message:
What is it I am doing wrong? Can someone help me please?
Thx