...

View Full Version : Netscape



oneplace
12-25-2006, 05:57 PM
Maybe some one can show me how to modify this script to work with both Netscape and Explorer. It no works only with explorer "disables the enter key"

<SCRIPT LANGUAGE="JavaScript">
function modifKey(e)
{
var modif='';
if (event.altKey)
{
modif+='[ Alt ] ';
}
if (event.ctrlKey)
{
modif+='[ Ctrl ] ';
}
if (event.shiftKey)
{
modif+='[ Shift ] ';
}
getKey(e,modif);
}
function getKey(e,modif)
{
if (e.keyCode)
{
keycode=e.keyCode;
}
else
{
keycode=e.which;
}
char=String.fromCharCode(keycode);
xCode=char.charCodeAt(0);
if (xCode == 13) //Enter key is pressed!!
{
window.event.keyCode = 0;
}
else
{
return true;
}
}


<body MS_POSITIONING="GridLayout" onkeypress=' return modifKey(event);'>

Philip M
12-26-2006, 09:40 AM
I don't use Netscape any more but this may do the trick:

<SCRIPT LANGUAGE="JavaScript">
if (document.layers) document.captureEvents(Event.KEYPRESS);
function modifKey(e)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum