I added an autocomplete field to my form. However, when I submit the form a var_dump shows my results as such:
array
'SearchForm' =>
array
'name' => string 'hjhk' (length=4)
'poster' => string '' (length=0)
'group' => string 'a' (length=1)
'yt0' => string 'Submit' (length=6)
<div class="form">
<?php echo CHtml::beginForm(); ?>
<?php echo CHtml::errorSummary($model); ?>
<div class="row">
<?php echo CHtml::activeLabel($model, 'name'); ?>
<?php echo CHtml::activeTextField($model, 'name') ?>
</div>
<div class="row">
<?php echo CHtml::activeLabel($model, 'group'); ?>
<?
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'model' => $model,
'name' => 'group',
'source' => array('ac1', 'ac2', 'ac3'),
));
?>
</div>
<div class="row">
<?php echo CHtml::activeLabel($model, 'poster'); ?>
<?php echo CHtml::activeTextField($model, 'poster') ?>
</div>
<div class="row submit">
<?php echo CHtml::submitButton('Submit'); ?>
</div>
<?php echo CHtml::endForm(); ?>
</div>
Can someone tell me what I’m missing to attach the field to the model?