Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding onkeypress to process Enter key on textbox drop
Message
From
14/12/2012 04:29:34
 
 
To
13/12/2012 13:42:55
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01559443
Message ID:
01559637
Views:
40
>IAC, after having verified a few things, it seems the onkeypress is not affected by the auto complete key press. I must have had a version that was outdated. So, that makes sense. The onkeypress at the HTML control is bound to the HTML control itself and not the auto complete which is driven by the browser.

I certainly could not see the behaviour. Down-arrowing to a listed item and hitting enter completed the text box but did not trigger the submit. Hitting Enter again submitted the form:
   <form id="form1" runat="server">
        <input id="Text1" type="text" onkeypress="return handleKeyPress(event)" /><br />
      <script type="text/javascript">
        function handleKeyPress(event)
        {
          // return event.keyCode != 13;
          return true;
        }
      </script>
      <input id="Submit1" type="submit" value="submit" />
    </form>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform