我有一个类型提前为我输入如下,如何限制提前输入选项从键盘中选择?
<input
typeahead-template-url="app/templates/type-a-head-item.html"
type="text"
ng-model="selectedDisease"
search-head="powerSearch"
typeahead-loading="loadingLocations"
typeahead-wait-ms="200"
typeahead-min-length="0"
placeholder="Disease, Procedure or Medicine"
typeahead="match as match._source.name for match in getDiseases($viewValue)"
typeahead-focus-first="false"
typeahead-editable="false"
typeahead-loading="loadingDiseases"
class="form-control input-lg ng-pristine ng-untouched ng-invalid ng-invalid-required magnifyInput Bcolor"
typeahead-on-select="searchDoctors()"
aria-autocomplete="list"
aria-expanded="false"
aria-owns="typeahead-12-6891">
我要选择的选项只从下拉而不是通过选择与键盘enter.I试过很多方法使用jQuery,但没有工作。任何人都可以请建议我help.Thanks。
$(document).keypress(function(e) {
if(e.which == 13) {
alert('You pressed enter!');
}
});
'我试过很多方法'=>试着分享。 –
@ mt1:您的问题已解决...?如果你找到了解决方案,那么你可以与我们分享... :) –