0

私はこのコードを使用しています。$ tempなどの変数に値を入れるにはどうすればよいですか?

$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>;
4

1 に答える 1

0

このhttp://api.jqueryui.com/autocomplete/イベントセクションをお読みください。使用selectまたはchangeイベント

$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
于 2012-11-26T05:16:49.783 に答える