Solved

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

Posted on 2004-10-05
5
786 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
  • 2
  • 2
5 Comments
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
have u used "document.onkeydown" event & "focus()" function in javascript ?
0
 

Author Comment

by:aris_datuin
Comment Utility
It is working now...!    Thanks...   =)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now