Answer the question
In order to leave comments, you need to log in
How to change selector in jQuery for AutoComplete in Yii2??
There is a field with autocomplete,
there is a result:
jQuery(document).ready(function () {
jQuery('#registrationform-city').autocomplete({"source":"\/site\/autocomplete","autoFill":true,"minLength":"0","select":function(event, ui) {
}});
<div><?= $form->field($model, 'city')->widget(
AutoComplete::className(), [
'clientOptions' => [
'source' => Url::to(['site/autocomplete']),
'autoFill' => true,
'minLength' => '0',
'select' => new JsExpression('function(event, ui) {
}')
],
'options' => [
'class' => 'form-control',
'placeholder' => Yii::t('app', 'Start typing the name')
]
]); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question