| Author |
keyCode - firefox
|
Joe Shannow
Ranch Hand
Joined: Dec 01, 2010
Posts: 35
|
|
Hi,
is here anybody who knows how to rewrite this javascript function (which works in IE8) to firefox?
function enter2tab(){
if(window.event.keyCode == 13 && window.event.srcElement.id !='scrap:btnSubmit') window.event.keyCode = 9;
}
When I press enter in irefox, form is submitted......
|
 |
Joe Shannow
Ranch Hand
Joined: Dec 01, 2010
Posts: 35
|
|
Some progress:
function enter2tab(e) {
if (e.keyCode == 13)
{
e.cancelBubble = true;
e.preventDefault();
e.returnValue = false;
e.keyCode = 9;
}
}
....onkeypress="enter2tab(event); ">
this function forbids enter to submitt form... but not change the key pressed to tab
|
 |
Joe Shannow
Ranch Hand
Joined: Dec 01, 2010
Posts: 35
|
|
Hmm, firefox seems not to be able to CHANGE key events on run.
I think, it can sniff the e.keyCode and tell what the key was pressed, but not to change it.
Am I right?
|
 |
 |
|
|
subject: keyCode - firefox
|
|
|