L
LilAndy23
How can I use the onKeyPress event handler in Firefox? onKeyPress
doesn't seem to fire in Firefox.
doesn't seem to fire in Firefox.
How can I use the onKeyPress event handler in Firefox? onKeyPress
doesn't seem to fire in Firefox.
if(code==13) {
if (e.keyCode) e.keyCode = 9;
else e.which = 9;
I modifed the code. It now looks like:
if(code==13) {
//I want to be able to set e.keyCode to 9 at this point
if (e.keyCode) {
document.frmCheckOut.ddlLID.focus();
} else {
document.frmCheckOut.ddlLID.focus();
}
this code fire within a form and so when enter is pressed, it keeps
trying to send/submit the form. Which is what I don't want to happen.
Does anyone know of an other approach to simulate a tab (or a switch of
focus) key by pressing the enter key (that is compatable with Mazilla
and IE)???
LilAndy23 said:I modifed the code. It now looks like:
if(code==13) {
//I want to be able to set e.keyCode to 9 at this point
if (e.keyCode) {
document.frmCheckOut.ddlLID.focus();
} else {
document.frmCheckOut.ddlLID.focus();
}
this code fire within a form and so when enter is pressed, it keeps
trying to send/submit the form. Which is what I don't want to happen.
Does anyone know of an other approach to simulate a tab (or a switch of
focus) key by pressing the enter key (that is compatable with Mazilla
and IE)???
Thanks
Andy
LilAndy23 said:Well, the reason why I need the enter key to simulate the tab key is
because I'm using a magnetic stripe reader to input the data directly
into the input form. When you swipe the plastic card with the mag
reader it automatically sends the enter key signal. This keeps trying
to submit the form. Therefore, I'm trying to figure a way to cancel
the submission and instead switch the focus to the next input field.
Any suggestions on how I can do this? Hopefully my explaination above
is enough to get some help or suggestions.
Andy
LilAndy23 said:Well, the reason why I need the enter key to simulate the tab key is
because I'm using a magnetic stripe reader to input the data directly
into the input form. When you swipe the plastic card with the mag
reader it automatically sends the enter key signal. This keeps trying
to submit the form. Therefore, I'm trying to figure a way to cancel
the submission and instead switch the focus to the next input field.
Any suggestions on how I can do this? Hopefully my explaination above
is enough to get some help or suggestions.
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.