Capturing enter key in the keyup or keydown event of a HTML textbox

Results 1 to 3 of 3

Thread: Capturing enter key in the keyup or keydown event of a HTML textbox

  1. #1
    Join Date
    Dec 1969
    Posts
    9

    Default Capturing enter key in the keyup or keydown event of a HTML textbox

    Hi,<BR>How do i capture the enter key in the keyup or keydown event of an HTML text box control. i have a text box and a submit button on an ASP page. once the user enters in the text box and presses enter key, the submit button gets activated. Instead the focus should remain in the text box or probably the next control could have the focus. <BR>Please advise.<BR><BR>Regards,<BR>Shruthi.

  2. #2
    Join Date
    Dec 1969
    Posts
    39

    Default RE: Capturing enter key in the keyup or keydown ev

    hai Shruthi<BR><BR> javascript may help you in this regard write a handle event <BR>so that user moves from the text box (onBlur) give a focus to the next text box like write this for textbox1 onblur=document.formname.textboxname2.focus()<BR>h ope this helps you <BR>Srinath<BR>srinathm@hotmail.com<BR>

  3. #3
    John Weeflaar Guest

    Default RE: Capturing enter key in the keyup or keydown ev

    Unfortunately the event handlers for Text box using JavaScript<BR>are only: onBlur, onChange, onFocus, and onSelect.<BR>There is no event handler such as keyup, keydown, etc that responds when we press &#060;Enter&#062; for example.<BR>If you want to have these, I think You&#039ll have to use ActiveX control (such as ActiveX Edit control) or Java Applet as they have more event handlers.<BR><BR>John

Posting Permissions

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