Solved

How can I capture in javascript ctrl-R or F5?

Posted on 2002-04-02
7
4,412 Views
Last Modified: 2007-12-19
Anuone has any code available of capturing the How can I capture in javascript ctrl-R or F5 key.

Thanks
Nesifa
0
Comment
Question by:nesifa
7 Comments
 
LVL 20

Accepted Solution

by:
jitganguly earned 30 total points
ID: 6913532
116 is the number. but it does not work with ctrl+R
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function getKey(keyStroke) {
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;

if (eventChooser==116)
alert("Please don't press f5");

}
document.onkeydown = getKey;
// -->
</SCRIPT>
</HEAD>
<BODY>
Press a key to see the ascii code.
</BODY>
</HTML>
0
 
LVL 5

Expert Comment

by:kcm76
ID: 6913590
HI GANGULY
IT's working even for CTRL+R

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function getKey(keyStroke) {
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;

if (eventChooser==116)
     alert("Please don't press f5");
if (event.ctrlKey)
     {
     if(eventChooser==82) alert("CTRL+R");
     }

}
document.onkeydown = getKey;
// -->
</SCRIPT>
</HEAD>
<BODY>
Press a key to see the ascii code.
</BODY>
</HTML>

KCM
0
 
LVL 3

Expert Comment

by:tejaspurani
ID: 6914075
still not disabling the F5 Function. can u do that?

TP
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 5

Expert Comment

by:kcm76
ID: 6914087
U cannot disable (built-in features) F1 - help, F3 - find, F4 - drop down address list - and so on.

KCM


0
 

Expert Comment

by:viapek
ID: 6914866
If you want to stop the refresh, add return false. This should stop it.

Ova
0
 
LVL 3

Expert Comment

by:tejaspurani
ID: 6915958
Viapek,

No it's not !!!!

TP
0
 

Author Comment

by:nesifa
ID: 6921759
You are the first and everybody else played with your original code. You deserve it.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question