Dear All ,
I couldn’t find what the problem with this code , But my autocompleate is not working…
Here I am trying to pass extra parameters to my autocompleate
[b]
VIEW CODE[/b]
<?php echo CHtml::dropDownList('type','',array('Company'=>'Company','Profession'=>'Profession','People'=>'People')); ?>
<?php
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>'test1',
'options'=>array(
'search'=>"js:function(){
$('#test1').autocomplete({
source : 'http://localhost/kingdom/index.php?r=myAutoComplete/autoCompleate/newparam=' + $('#type :selected').text()
});
}"
),
));
?>
Controller code
public function actionAutoCompleate()
{
$newparam = CHttpRequest::getParam('newparam');
if(isset($_GET['term']) ){
echo CJSON::encode(array('one', 'two', 'three','one1', 'two2', 'three3'));
Yii::app()->end();
}
}
Thanks for your help
Regards
Yii Fan