P
please-answer-here
Scenario:
I'm using the following code to avoid that users use the return key in the
middle of a form to submit the entire form
---- snip ---------
function kH(e) {
var pK = document.all? window.event.keyCode:e.which;
return pK != 13;
}
document.onkeypress = kH;
if (document.layers) document.captureEvents(Event.KEYPRESS);
---- snip ---------
What I would do is to modify the code so that when the users is in a
textarea input field they are allowed to use the return key. Is there a
funcion/method I can use in the function to test in which named input field
is the active one?
I'm using the following code to avoid that users use the return key in the
middle of a form to submit the entire form
---- snip ---------
function kH(e) {
var pK = document.all? window.event.keyCode:e.which;
return pK != 13;
}
document.onkeypress = kH;
if (document.layers) document.captureEvents(Event.KEYPRESS);
---- snip ---------
What I would do is to modify the code so that when the users is in a
textarea input field they are allowed to use the return key. Is there a
funcion/method I can use in the function to test in which named input field
is the active one?