Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding onkeypress to process Enter key on textbox drop
Message
De
14/12/2012 04:29:34
 
 
À
13/12/2012 13:42:55
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01559443
Message ID:
01559637
Vues:
39
>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>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform