473,320 Members | 1,926 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,320 software developers and data experts.

disable spacebar pagedown in IE ?

1
Hi guys!

I'm currently building web application that make use of the spacebar and I need to disable the automatic pagedown that is taking place when pressing the spacebar. In Firefox, I use the following javascript on pageload

Expand|Select|Wrap|Line Numbers
  1. window.onkeydown=function(e){ 
  2.     if(e.keyCode==32){ 
  3.            return false; 
  4.      } 
  5. };
  6.  
Obviously, it doesn't work in IE....anybody with a solution?

Thanks!
Ben.
Dec 23 '07 #1
1 3650
gits
5,390 Expert Mod 4TB
hi ...

IE uses a global event object and has no stopPropagation ... so the following might help :)

Expand|Select|Wrap|Line Numbers
  1. window.onkeydown = function(e) {
  2.     var evt = typeof window.event != 'undefined' ? window.event : e;
  3.  
  4.     if (evt.keyCode == 32) { 
  5.         if (evt.stopPropagation) {
  6.             evt.stopPropagation();
  7.         } else {
  8.             evt.cancleBubble = true;
  9.             evt.returnValue = false;
  10.         }
  11.     } 
  12. }
  13.  
kind regards
Dec 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: yihan | last post by:
Hi, I would like to make a pageUp and pageDown button to go up or down in the text ( it is like PgUp/PgDown on the keyboard). But it works on the IE but not on netscape 7.1. Could somebody tell me...
1
by: Zach | last post by:
Hello. When editing XML in the Data view mode in Visual Studio .NET, if I press the spacebar while holding shift, it will select the entire row of data I'm working with, rather than just insert a...
1
by: julio | last post by:
I noticed that pressing spacebar when a listbox has the focus scrolls the listbox to the first selected item. I'm intercepting the spacebar press event at form level for stopping and starting...
1
by: Harald Solvberg | last post by:
I want a datagrid object that will not intercept PageUp or PageDown keystrokes so that instead the tabcontrol it's on can pick it them up and change TabPages. Any idea how to create a new version...
2
by: L Mehl | last post by:
Hello -- Sometimes the code editor ignores the spacebar, and requires me to cursor through the line, after entering it, and hit the spacebar where I need a space. Has anyone experienced this?...
16
by: MLH | last post by:
In Access 97 and Access 2.0 applications, if a command button has the focus, the spacebar will 'PRESS" the key. How does one go about disabling this annoying BEATURE?
16
by: nagmvs | last post by:
Hi, Can any one tell me How to disable Keyboard Functions using JavaScript.If knows please tell me the code.Also tell me the code for mouse disable also. Thanks, Nagesh.
2
by: ssubbarayan | last post by:
Dear all, I am in the process of implementing pageup/pagedown feature in our consumer electronics project.The idea is to provide feature to the customers to that similar to viewing a single sms...
9
by: ssubbarayan | last post by:
Dear all, I am in the process of implementing pageup/pagedown feature in our consumer electronics project.The idea is to provide feature to the customers to that similar to viewing a single sms...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: 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...
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)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.