【发布时间】:2017-09-27 09:21:10
【问题描述】:
我正在实现 typeahead 自动完成选择,点击下拉选项后,将框从 From 更改为 To 但是当我选择使用 Enter 键 的下拉选项不会像上面那样更改框。
请告诉我该怎么办?
From: <input type="text" name="from" autocomplete="off" class="form-control inputTxtLarge inputSrc typeahead tt-query" placeholder="From: City or Airport" id="from_city" value="Delhi (India) DEL" spellcheck="false" required>
To: <input type="text" name="to" autocomplete="off" id="go_dest" class="form-control inputTxtLarge inputDest typeahead tt-query" placeholder="To: City or Airport" spellcheck="false" required>
用于将 From 更改为 To
的 javaScript 函数$(document).on('click', '.tt-selectable', function(){
$( "#go_dest" ).focus();
});
【问题讨论】:
-
如何调用 typeahead 函数 - 请显示您的代码,以及您使用的是哪个版本的 typeahead?
-
代码较长,无法在注释框中显示代码,版本为0.11.1
-
我的意思只是调用 - $("....").typeahead ....
标签: javascript html codeigniter autocomplete typeahead.js