Click to See Complete Forum and Search --> : newbie needs help!


lucidnote
07-24-2003, 03:19 PM
Thanks for reading this in advance,

I have a form that is evaluated in a browser side javascript function called "Login()". The function runs when you push the submit button with an onClick handler, however when you push enter it does not run the function. Here is the code that I have to capture the keypress:

function netscapeKeyPress(e) {
if (e.which == 13)
Login();
}
function microsoftKeyPress() {
if (window.event.keyCode == 13)
Login();
}
if (navigator.appName == 'Netscape') {
window.captureEvents(Event.KEYPRESS);
window.onKeyPress = netscapeKeyPress;
}

What am I doing wrong? Please help.

Thanks

David Harrison
07-24-2003, 04:14 PM
Try this: