Change Enter to Tab in Firefox

P

Paul Lautman

Hi y'all,
In IE using this trick
onKeyDown="if (window.event.keyCode==13) window.event.keyCode=9;
(from http://support.microsoft.com/default.aspx/kb/828907)
I can cause an enter key press in an input box to tab to the next field.

However in Firefox keyCode is a get only property.

How can I make Firefox issue a tab in response to an enter press?

TIA
Regards
Paul
 
L

-Lost

Paul said:
Hi y'all,
In IE using this trick
onKeyDown="if (window.event.keyCode==13) window.event.keyCode=9;
(from http://support.microsoft.com/default.aspx/kb/828907)
I can cause an enter key press in an input box to tab to the next field.

However in Firefox keyCode is a get only property.

How can I make Firefox issue a tab in response to an enter press?

TIA
Regards
Paul

You might benefit from Stephane Moriaux's "test de capture touche [Enter]."

http://perso.orange.fr/stephane.moriaux/truc/key_enter_tab.htm
 
P

Paul Lautman

-Lost said:
Paul said:
Hi y'all,
In IE using this trick
onKeyDown="if (window.event.keyCode==13) window.event.keyCode=9;
(from http://support.microsoft.com/default.aspx/kb/828907)
I can cause an enter key press in an input box to tab to the next
field. However in Firefox keyCode is a get only property.

How can I make Firefox issue a tab in response to an enter press?

TIA
Regards
Paul

You might benefit from Stephane Moriaux's "test de capture touche
[Enter]."
http://perso.orange.fr/stephane.moriaux/truc/key_enter_tab.htm

Hmmm, just might work. Depends whether "nextSibling" will jump over hidden
input fields like the IE code does.
 
L

-Lost

Paul said:
-Lost said:
Paul said:
Hi y'all,
In IE using this trick
onKeyDown="if (window.event.keyCode==13) window.event.keyCode=9;
(from http://support.microsoft.com/default.aspx/kb/828907)
I can cause an enter key press in an input box to tab to the next
field. However in Firefox keyCode is a get only property.

How can I make Firefox issue a tab in response to an enter press?

TIA
Regards
Paul
You might benefit from Stephane Moriaux's "test de capture touche
[Enter]."
http://perso.orange.fr/stephane.moriaux/truc/key_enter_tab.htm

Hmmm, just might work. Depends whether "nextSibling" will jump over hidden
input fields like the IE code does.
I am afraid not. His code will actually choke at that point. By choke
I mean cease to function properly.
 
C

Captain Paralytic

Paul said:
-Lost said:
Paul Lautman wrote:
Hi y'all,
In IE using this trick
onKeyDown="if (window.event.keyCode==13) window.event.keyCode=9;
(fromhttp://support.microsoft.com/default.aspx/kb/828907)
I can cause an enter key press in an input box to tab to the next
field. However in Firefox keyCode is a get only property.
How can I make Firefox issue a tab in response to an enter press?
TIA
Regards
Paul
You might benefit from Stephane Moriaux's "test de capture touche
[Enter]."
http://perso.orange.fr/stephane.moriaux/truc/key_enter_tab.htm
Hmmm, just might work. Depends whether "nextSibling" will jump over hidden
input fields like the IE code does.

I am afraid not. His code will actually choke at that point. By choke
I mean cease to function properly.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.- Hide quoted text -

- Show quoted text -

Maybe I could build a loop to look for the next non-hidden input
element.
 
B

brunascle

Hi y'all,
In IE using this trick
onKeyDown="if (window.event.keyCode==13) window.event.keyCode=9;
(fromhttp://support.microsoft.com/default.aspx/kb/828907)
I can cause an enter key press in an input box to tab to the next field.

However in Firefox keyCode is a get only property.

How can I make Firefox issue a tab in response to an enter press?

TIA
Regards
Paul

that sounds like a flaw in IE then. you definitely should not be
allowed to change the keyCode of an event.

if you want to stop hitting enter from submitting the form, you can
add onsubmit="return false" to the form element. then, the form will
only sumit if you call its submit() function in the javascript. then
it's just a matter of calling focus() on the next item when the
keyCode is 13.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top