Solved

Prohibiting F5 Key in browser

Posted on 2009-05-11
5
379 Views
Last Modified: 2013-12-08
My web application uses internet explorer browser, and I need to prevent the user from hitting F5 key, Backspace key, ALT + Arrow Keys and Mouse right click events.
How do I accomplish this using javascript?
0
Comment
Question by:sputrevu
  • 2
5 Comments
 
LVL 6

Expert Comment

by:jaydee-cdgp
ID: 24361802
0
 

Expert Comment

by:isuhendro
ID: 24361826
have you tried Prototype Javascript library.. ? it should help you to produce better quality of code
0
 
LVL 11

Accepted Solution

by:
Muhammad Ousama Ghazali earned 500 total points
ID: 24362037
Whatever code you may try to restrict user from pressing F5 so the user simply could not cause multiple postbacks, as is the most common scenario, there is always alternates to perform the refresh of the page.

So it is better to code in your server-side script (ASP.NET, PHP) appropriately to restrict user from performing multiple postbacks.
0
 
LVL 11

Expert Comment

by:Muhammad Ousama Ghazali
ID: 24362071
Anyways, for quick overview into keyboard and mouse events: see these links:

http://www.javascriptkit.com/jsref/eventkeyboardmouse.shtml
http://www.quirksmode.org/js/events_properties.html

For a detailed discussion on events and cross browser compatibilities see these links:

http://www.quirksmode.org/js/introevents.html
http://www.quirksmode.org/dom/events/index.html
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Due to recent concerns over the inevitable depletion of the current pool of IPv4 addresses and the desire to provide additional functionality for modern devices, an upgrade to IPv6 on my Internet connection was needed for me to explore the world of …
How many times have you been browsing the internet, with multiple tabs open, and closed the wrong one? Have you ever clicked 'Close all tabs' instead of 'Close current tab' ? Internet Explorer 8 now brings to you, what Firefox has had for a wh…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now