Solved

Upon clicking of Tab, focus goes to address bar...

Posted on 2004-10-05
5
809 Views
Last Modified: 2010-05-18
Hi Experts,

I am trying to control the tab key to go to the next textbox...    

However as I focus on my first textbox during OnLoad and then press Tab key, instead of going to my 2nd textbox, it goes to the address bar...

May I ask how to solve this...?   A sample code would be best...


Thanks in advance experts...!   =)
0
Comment
Question by:aris_datuin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 12224624
Hi aris_datuin,

Have this:

<input type="text" tabindex="2"> for your second text box, although it should work without that...  

Regards,
Zyloch
0
 

Author Comment

by:aris_datuin
ID: 12224810
Also, I have another dillemma on how to control th F3 key so that it can call a javascript fuction anytime...   Right now, I have onKeyPressed on my first textbox...   But if the focus is on another object, it is not working unless I also put onKeyPressed on all of my objects...   However, if none of my objects is in focus, how will I control the F3 key...?

Thanks in advance again...!   =)
0
 
LVL 36

Accepted Solution

by:
Zyloch earned 50 total points
ID: 12225226
Do something like this:

document.onkeyup=handleFT;

function handleFT(e) {
   var key=(window.event)?window.event.keyCode:e.which;
   if (key==114) {//If F3
      //Do this
   }
}
0
 

Expert Comment

by:payalpr2002
ID: 12225759
have u used "document.onkeydown" event & "focus()" function in javascript ?
0
 

Author Comment

by:aris_datuin
ID: 12236841
It is working now...!    Thanks...   =)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question