如何在yii中获取CJuiAutoComplete文本字段中的值?
我正在使用这个代码。如何将值放入变量中,比如$temp如何在yii中获取CJuiAutoComplete文本字段中的值?,autocomplete,yii,Autocomplete,Yii,我正在使用这个代码。如何将值放入变量中,比如$temp $this->widget('zii.widgets.jui.CJuiAutoComplete', array( 'name'=>'patientSearch', 'source'=>$arr, // additional javascript options for the autocomplete plugin 'options'=>array( 'minLengt
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>'patientSearch',
'source'=>$arr,
// additional javascript options for the autocomplete plugin
'options'=>array(
'minLength'=>'2',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
$temp = <value of autocomplete form>;
$this->widget('zii.widgets.jui.cguiautocomplete',数组(
'name'=>'patientSearch',
“源”=>$arr,
//自动完成插件的其他javascript选项
“选项”=>数组(
'minLength'=>'2',
),
“htmlOptions”=>数组(
'样式'=>'高度:20px;'
),
));
$temp=;
阅读此事件部分。使用选择
或更改
事件
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>'patientSearch',
'source'=>$arr,
// additional javascript options for the autocomplete plugin
'options'=>array(
'minLength'=>'2',
'select' => 'js:function(event, ui) {
$temp = event.currentTarget.value;
}',
'change' => 'js:function(event, ui) {
$temp = event.currentTarget.value;
}',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
var $temp = ''; // init global variable
我认为
'select'=>'js:function(event,ui){$temp=event.currentTarget.value;}',
会给出结果。