Bman900
(Balint2005)
1
For some reason I can not have more then one CJuiAutoComplete field on a page. If I do, only one of them works. Here is the code I use for both:
<?php
echo CHtml::beginForm(array('search/search'), 'get', array('style'=> 'inline'));
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'attribute'=>'name',
'model'=>'listing',
'sourceUrl'=>array('listing/aclist'),
'name'=>'q',
'options'=>array(
'minLength'=>'1',
),
'htmlOptions'=>array(
'size'=>95,
'maxlength'=>80,
),
));
echo CHtml::submitButton('Go!',array('style'=>'width:50px;')) .
CHtml::endForm('');
?>
kabira
(Jlsindore)
2
Please assign unique ids to each CJuiAutoComplete widget. Check following code snippets:
<?php
echo CHtml::beginForm(array('search/search'), 'get', array('style' => 'inline'));
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'id' => 'autocompleteid1',
'attribute' => 'name',
'model' => 'listing',
'sourceUrl' => array('listing/aclist'),
'name' => 'q',
'options' => array(
'minLength' => '1',
),
'htmlOptions' => array(
'size' => 95,
'maxlength' => 80,
),
));
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'id' => 'autocompleteid2',
'attribute' => 'nameother',
'model' => 'listing',
'sourceUrl' => array('listing/aclistother'),
'name' => 'q',
'options' => array(
'minLength' => '1',
),
'htmlOptions' => array(
'size' => 95,
'maxlength' => 80,
),
));
echo CHtml::submitButton('Go!', array('style' => 'width:50px;')) .
CHtml::endForm('');
?>