简体   繁体   English

文本框自动完成时触发JavaScript事件?

[英]Fire a javascript event when textbox is autocomplete?

I need to enable a button when a textbox is filled. 填充文本框后,我需要启用一个按钮。 However no javascript event is fired when you fill the textbox using the browser autocomplete function, so I need a way to catch this "event". 但是,当您使用浏览器自动完成功能填充文本框时,不会触发任何javascript事件,因此我需要一种方法来捕获此“事件”。 I tryed many javascript events like change focus but they aren't fired when you select and option in the autocomplete "combo". 我尝试了许多JavaScript事件,例如更改 焦点,但是当您在自动完成“组合”中选择和选项时,它们并未触发。

$('#mytextbox').on('change', function(){
   $('#mybutton').removeAttr('disbled');
});

Have you try to use jquery ui autocomplete ? 您是否尝试过使用jQuery ui autocomplete?

http://jqueryui.com/autocomplete/#combobox http://jqueryui.com/autocomplete/#combobox

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用JavaScript更改值时如何触发TextBox更改事件? - How to fire TextBox change event when value is changed using javascript? 为什么在启用自动填充功能时,javascript onchange事件不会触发? - Why does the javascript onchange event not fire if autocomplete is on? 通过 Javascript 触发 asp:TextBox 的 ontextchanged() 事件 - Fire ontextchanged() event of an asp:TextBox via Javascript 使用JavaScript代码在文本框上触发退格事件 - Fire backspace event on textbox using javascript code 当 readonly 为 true 时触发 TextBox 的 onchange 事件 - Fire onchange event for TextBox when readonly is true 文本框更改时的Javascript和Jquery触发功能 - Javascript and Jquery fire function when textbox changes 当文本由javascript更改时,Fire TextChanged用于文本框 - Fire TextChanged for textbox when the text changed by javascript JavaScript:在文本框上方时,不会触发Mousewheel事件 - JavaScript: Mousewheel event doesn't fire while over textbox asp.net/javascript,为什么文本框的onChange事件不触发? - asp.net/javascript, why is textbox onChange event does not fire? javascript触发动态生成的按钮的事件,以删除文本框和单选按钮 - javascript to fire event of dynamically generated button to remove textbox and radio button
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM