Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 11,839 times

Related Categories

Converting a CR to a TAB in a Web Page

LACanadian

Illustrates a technique that can be used to allow the ENTER key to navigate between fields on a web page.


Do you users complain about having to use the TAB key to move from field to field on your web page? The code below contains an illustration of a technique that will convert a Carriage Return to a TAB character. Naturally, you can change the pseudo-TAB key by modifying the ASCII value that is part of the test.  

 <SCRIPT language="javascript">
<!-- function TranslateKey(keypress) {
  if ( event.keyCode == 13) { event.keyCode = 9; }
  }
window.document.onkeydown = TranslateKey ;
//-->
</SCRIPT>

I am the owner of a small application development consulting company that specialized in the design and implementation of Internet-based applications. While there are others who can make a web site look good, our expertise is in making the site function. This includes infrastructure design, database design and administration, software development and deployment. For the most part, we utilize Microsoft-based languages and tools. And we are skilled enough to have generated two patent applications for our clients.

Comments

  • Posted by LACanadian on 26 Feb 2003

    The examples uses the onKeyDown event for the document. I believe that there is an onKeyDown for each input element. So you could add the OnKeyDown=procname in each element that you want to implemen...

  • How do you Turn this Off

    Posted by JavaScripter on 24 Sep 2002

    This is great for skipping from text field to text field with the CR. But when focus goes to a Submit button it forces a mouse click. How can I kill this when focus leaves the text fields?