473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Cancelling Function Keys in Netscape with Javascript

mgw
Hi,

I'm trying to cancel the Shift+F3 key combination in Netscape 7.2 from
performing the F3 key's default action of opening the Find dialog. I'm
unable thus far to prevent the Find dialog from appearing after
following steps listed in numerous posts in this group.

I detect the onkeydown event of the body as follows:

<body onkeydown="return bodyOnKeyPress(event);">

My bodyOnKeyPress event is as follows:

function bodyOnKeyPress(evt)
{
if(evt.keyCode == 114 && evt.shiftKey)
{
if(navigator.appName == "Netscape")
{
evt.preventDefault();
}
else
{
evt.keyCode = 0;
evt.returnValue = false;
}

evt.cancelBubble = true;
return false;
}
}

Does anyone see perhaps something that I'm doing wrong? Any help would
be greatly appreciated.

Thanks,
Mike
Jul 23 '05 #1
3 1463


mgw wrote:

I detect the onkeydown event of the body as follows:

<body onkeydown="return bodyOnKeyPress(event);">


Well you can only cancel keypress events in Netscape/Mozilla so try
<body onkeypress="return bodyOnKeyPress(event);">

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
On 28 Nov 2004 09:04:19 -0800, mgw <co*********@yahoo.com> wrote:

[snip]

Martin answered your question, but...
if(navigator.appName == "Netscape")
{
evt.preventDefault();
}


....nonsense.

if(evt.preventDefault) {
evt.preventDefault();
}

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3
mgw
I have changed the code to match your suggestion...

[snip]
if(evt.preventDefault) {
evt.preventDefault();
}

[snip]

....unfortunately the Find dialog is still being displayed. Is it
really not possible to prevent the display of this dialog by
cancelling out the pressing of the F3 key?
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stephen Poley | last post by:
Apologies if this is a silly question, but Googling on the archive didn't produce any answers. I have a piece of inline Javascript which works as expected in IE 6, Opera 7, Mozilla and NN 4. In...
4
by: Yvan J. Gagnon | last post by:
I am encountering a strange problem in Netscape 7 with a CFM file I am trying to troubleshoot (the page is working fine in NS Communicator and IE). Below is a sample of the problematic line of...
1
by: beavenour | last post by:
I am looking for some help creating a more universal function out of this lame attempt at javascript. I have little experience with javascript and want to be able to universalize this function. ...
1
by: Christian Radermacher | last post by:
Hi, the following code has the mentioned behaviour: <html> <head> <script type="text/javascript"> function newA() { for (i=0;i<3;i++) { var a = window.frames.document.createElement("a");
15
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls...
1
by: Paul THompson | last post by:
I have been working for some time to 1) detect tab and shift tab events 2) control the focus on the basis of these events. I have found that I can do this, but continue to have nagging problems. ...
16
by: Michael Winter | last post by:
Other than throwing an exception during the execution of an object's constructor, is there any way to cancel creation of the object in such a way that it leaves a reference to it null or undefined....
5
by: Ken | last post by:
I want to write a js variable inside a function to a web page. test.js try_picture(); function try_picture() { var picture = '<tr><td colspan=2 align=right><font size=2>Picture...
0
by: excelleinc.com | last post by:
Hello, I know that this question was here quite a few times but I was wondering if anyone atually found a solution/work around for it. I'm trying to prevent users from deleting certain rows in...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.