Tag: enter

In order to disable the ENTER key in your textbox type input, you have to add the ‘onkeydown’ attribute and call a javascript function that checks the key and avoid to submit the form when you press ENTER key. Input example <input name="myName" type="text" value="Search" onclick="eraseInitialText(this);" onkeydown="disableEnter();"> Javascript function function disableEnter() { var key = […]
In order to avoid ENTER key in your asp:TextBox you’ve to add onkeydown event and control it, like this: <asp:TextBox ID="myTextBox" runat="server" onkeydown="return (event.keyCode != 13);"></asp:TextBox>