I had before this code that worked very well, but now, it does not work anymore in Chrome and IE10. I don't know why
Javascript
function EnterEvent(e, ctrl) {
var keycode = (e.keyCode ? e.keyCode : e.which);
if (keycode == 13) {
$('[id$=btnSave]').click();
}
else {
return false;
}
}
HTML
<asp:TextBox ID="txtAdd" runat="server" onkeyup="EnterEvent(event, this)" />
<asp:LinkButton ID="btnSave" runat="server" OnClick="btnSave_Click"></asp:LinkButton>
Server side
protected void btnSave_Click(object sender, EventArgs e)
{
//Operations
}
I ve already replaced this $('[id$=btnAddItem]').click();
with $('#btnAddItem').click();
but nothing at all. The server side is never triggered.
I had my controls in a ajaxpanel but like this it worked before. I tested with F12 developer tools. I arrived to the click part but nothing
Any ideas? thanks!