Not logged in - Login

Web Page- Prevent 'Enter' Key from Firing Button

Use the following to prevent the 'Enter' key from firing any button within the <div> element.

<div onkeypress="javascript: return false;">
   <!-- add other html controls in here -->
</div>

In ASP.Net:

<asp:Panel ID="Panel1" runat="server" DefaultButton="btnCatchEnterKey">
   <asp:Button ID="btnCatchEnterKey" runat="server" Text="" OnClientClick="return false;" style="display: none;" />
   <!-- add other html controls in here -->
</asp:Panel>