I am facing an issue with 2 textboxes and 2 buttons that are linked in a specific way (first textbox-first button/second textbox-second button). When a user enters text in the first textbox and presses enter, it should activate button1. Similarly, when the user focuses on the second textbox and presses enter, it should activate button2. I have attempted a solution but unfortunately, it is not working as expected.
document.getElementById('<%=txtYonSif.ClientID%>').addEventListener("keyup", function (evente) {
evente.preventDefault();
if (event.keyCode === 13) {
document.getElementById('<%=btnPanelYonetici.ClientID%>').click();
}
});
document.getElementById('<%=txtKulSif.ClientID%>').addEventListener("keyup", function (event) {
event.preventDefault();
if (event.keyCode === 13) {
document.getElementById('<%=btnPanelKullanici.ClientID%>').click();
}
});