Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This submitscript works in Netscape 4 but not in N6 - N. Why???

Status
Not open for further replies.

mstorsjo

Programmer
Joined
Apr 12, 2001
Messages
3
Location
SE
Would like to submit the form by pressing enter. This script works except for N6 and N7. Why ???

function checkKey()
{
if (window.event.keyCode == 13)
{
functionSubmitFormIE(1);
}
}

function nscheckKey(e)
{
if (e.which == 13)
{
functionSubmitFormNE(1);
}
}

if (navigator.appName == 'Netscape') {
window.captureEvents(Event.KEYPRESS);
window.onKeyPress = nscheckKey;
}

<BODY onkeypress=&quot;checkKey();&quot;>
 
you arn't calling the ns version of the function because you overwrite it with:

<BODY onkeypress=&quot;checkKey();&quot;>

try changin this statement:

if (navigator.appName == 'Netscape') {
window.captureEvents(Event.KEYPRESS);
window.onKeyPress = nscheckKey;
}else{
window.onKeyPress = checkKey;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top