Hi,
I’m trying to use the CJuiAutoComplete in a CForm with the Yii Form Builder in order to let the user select a city from a predefined list if cities (city/index). To realize this, I’m using a hidden field to store the city id (i.e. an integer) and the CJuiAutoComplete widget:
...
'city_id' => array(
'type' => 'hidden',
),
'city' => array(
'type' => 'zii.widgets.jui.CJuiAutoComplete',
'attributes' => array(
'attribute' => 'city',
'source' => Yii::app()->urlManager->createUrl('city/index'),
'options' => array(
'showAnim' => 'fold',
'select' => "js:function(event, ui) {
$('#Profile_city_id').val(ui.item.id);
}",
),
),
),
...
The problem is that the auto-complete text field does not appear in the form.
What’s wrong ? Thank you,
Fabrice