I want to trigger button's click event when user types something in textbox. I have written the following textbox control and JQuery:
<asp:textbox id="description" runat="server" class="myclass">
<asp:Button id="btnApply" runat="server">
$(function () {
$(".myClass").keyup(function (event) {
$("#<%=btnApply.ClientID%>").click();
});
});
When i enter first character in the textbox, the click event of button is triggered. But when i continue typing in the textbox the click event of button is not triggered on each key press. If i use keypress or keydown same issue is there along with textbox value is not retained. while when using keyup, the textbox is retained.
.click()callstrigger("click") internally. james.padolsey.com/jquery/#v=1.10.2&fn=jQuery.fn.click$("#<%=btnApply.ClientID%>")instead of$('#btnApply')?