473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

CLASSIC enter key fires tab action to focus on other ctrl not working in ff

Hi,the following code works in the latest version of IE but doesnt work in the latest version of FireFox. Tried everything on available on the web. Im using ASP.NET & VS2008 but have this code on the client:

javascript:if (event.keyCode==13) {event.keyCode=9; return event.keyCode }

Thanks.
Sep 3 '10 #1

✓ answered by Dormilich

IE uses a different event model than all other browsers. put simply, there is no global event object in FF.

the standard (DOM) defines that the event object is passed as first and only parameter in the executing function:
Expand|Select|Wrap|Line Numbers
  1. function test(evt)
  2. {
  3.     alert(evt.keyCode);
  4. }
  5. window.addEventListener("keydown", test, false);

6 2107
Dormilich
8,658 Expert Mod 8TB
IE uses a different event model than all other browsers. put simply, there is no global event object in FF.

the standard (DOM) defines that the event object is passed as first and only parameter in the executing function:
Expand|Select|Wrap|Line Numbers
  1. function test(evt)
  2. {
  3.     alert(evt.keyCode);
  4. }
  5. window.addEventListener("keydown", test, false);
Sep 3 '10 #2
You are AWESOME. THANKS! I was driving insane!
Sep 3 '10 #3
Dormilich
8,658 Expert Mod 8TB
it doesn’t get better once you discover, what awesome stuff you can do with DOM3 Events.
Sep 3 '10 #4
yet, if i have window.addEventListener("keydown", Test, false); and the following, i cant throw a TAB action.

Expand|Select|Wrap|Line Numbers
  1.         function Test(evt) {
  2.             var keynum;
  3.             keynum = evt.which;
  4.             alert(keynum);
  5.             keynum = 9;
  6.             alert(keynum);
  7.             return keynum; 
  8.         }
Any hints? Thanks.
Sep 3 '10 #5
Dormilich
8,658 Expert Mod 8TB
what do you mean by "throw a tab action"?
Sep 3 '10 #6
Hi,what i want is that when a user presses ENTER key the focus goes to the next control in FireFox.
If you press the TAB key in any page, you will see that the focus moves from control to control, i want to do that when a user presses the ENTER key. In IE i can capture the keyCode, i can see if its value is 13 (thats ENTER) and edit its value by a 9(thats TAB), so that i can then return the keyCode.
Example:if (event.keyCode==13) {event.keyCode=9; return event.keyCode }
Sep 3 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: deko | last post by:
I have a several forms that accept user input in a textbox and then take some action based on that input after a command button is clicked. Is it possible issue the command when the user presses...
7
by: (Pete Cresswell) | last post by:
I've got KeyDown coding and it fires when other keys are pressed, but when Enter is pressed, nothing. I'd like to support the (standard?) Windows behavior of executing DblClick processing when...
0
by: Ron Andersen | last post by:
I have C# custom actions and merge modules created in Visual Studio to install some components of the application I am working on. The merge modules are used with an Install Shield 9 project. ...
1
by: w | last post by:
Hi everyone, Just wondering if any one knows whether an event fires when focus switches onto a control. I need to perform some actions when some one clicks on and off a grid... is there...
2
by: 23s | last post by:
My site's login page has a form w/ 2 textboxes and a submit button. If I'm in either of those textboxes (i.e., either one of the textboxes has focus), in any given browser, hitting "enter" on my...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
3
by: AnalogKid17 | last post by:
I have the following line of code in my start/login page: document.getElementById("txtLogin").focus(); When I run the website app through F5 (Debug, Start Debugging) it works fine (ie, focus...
7
by: tekeste | last post by:
Private Sub combobox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbcombobox1.KeyPress If Asc(e.KeyChar) = Keys.Enter Then ...
3
by: buddyr | last post by:
can I use VB to work in microsoft excel to cause the enter button to shift to the right instead of down. I only want one worksheet to have this in. Trying to get code in Private Sub...
18
by: vetrib2w | last post by:
Hi , In short: How to change the form action attribute value using javascript and that need to supported in IE also ? BRIEF: I am using ajax function to submit the form. I am also...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.