How to handle Enter Key

Results 1 to 3 of 3

Thread: How to handle Enter Key

  1. #1
    Join Date
    Dec 1969

    Default How to handle Enter Key

    I have a login page with login id and password in textbox and a submit button. Whenever the user presses enter button from password textbox , the page should submit instead of user presses tab button and goes to submit button and then submit the form.

  2. #2
    Join Date
    Dec 1969

    Default RE: How to handle Enter Key

    &#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR>&#060;!-- <BR>netscape = "";<BR>ver = navigator.appVersion; len = ver.length;<BR>for(iln = 0; iln &#060; len; iln++) if (ver.charAt(iln) == "(") break;<BR>netscape = (ver.charAt(iln+1).toUpperCase() != "C");<BR><BR>function keyDown(DnEvents) { // handles keypress<BR>// determines whether Netscape or Internet Explorer<BR> k = (netscape) ? DnEvents.which : window.event.keyCode;<BR> if (k == 13) { // enter key pressed<BR> document.forms.Entry.submit();<BR> }<BR>}<BR>document.onkeydown = keyDown; // work together to analyze keystrokes<BR>if (netscape) document.captureEvents(Event.KEYDOWN&#124Event.KEY UP);<BR>// --&#062;<BR>&#060;/script&#062;

  3. #3
    billa Guest

    Default RE: How to handle Enter Key

    Yaar tell me one thing is it possible to secure your ASP code, mean can we make a sort of exe file so that no one can see the source code.<BR>thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts