我正在尝试为两个输入字段自动完成:City 和 locality。我希望本地提示基于 City 字段中的值:这是我拥有的当前代码:
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>'Address[locality]',
'value'=>$Address->locality,
'source'=>CController::createUrl('site/suggestLocation'),
'options'=>array(
'minLength'=>'2',
'focus'=>'js:function( event, ui ) {
$( "#Users_locality" ).val( ui.item.label );
return false;
}',
'select'=>'js:function( event, ui ) {$("#Users_locality").val( ui.item.label );$("#User_church").val( ui.item.value ); return false; }',
),
'htmlOptions'=>array(
'class' => 'login_textbox', 'autocomplete'=>'off',
),
));