Results 1 to 2 of 2

Thread: onKeyPress

  1. #1
    John Leyland Guest

    Default onKeyPress

    I am using ASP&#039s with Jscript and have 2 forms on a page, each within a separate table. Each form has an ACTION=&#060;%CreateLink("...") that works fine when you click on the "image" buttons.<BR><BR>What I need is for the same action to happen when hitting the "Enter" key. I have tried numerous onKeyPress= event handlers but can&#039t seem to get something that works.<BR><BR>This has to work in IE and Netscape.<BR><BR>Any help would be greatly appreciated.<BR><BR>Thanks,<BR>John Leyland

  2. #2
    Join Date
    Dec 1969

    Default RE: onKeyPress

    This JavaScript converts a "enter" key to "tab" so that it<BR>IE does not submit a form. Embed a "onkeydown=EnterTab()" in<BR>an &#060;input type="text"&#062; or &#060;input type="radio"&#062;. I have not<BR>been able to get the onkeypress, onkeydown or onkeyup events to<BR>work reliably in NetScape. <BR><BR>function EnterTab()<BR>if (window.event.keyCode==13)<BR> {window.event.keyCode = 9;} <BR>}

Posting Permissions

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