473,785 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

disable spacebar pagedown in IE ?

1 New Member
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 3673
gits
5,390 Recognized Expert Moderator Expert
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
5560
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 the problem? Thanks. The code as below: <HTML> <style type="text/css"> <!-- body
1
1973
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 space. Is there any way to disable this?
1
1897
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 audio playback, so I would like to remove the default behaviour form the listbox, and also from other buttons and controls. I tryed ( following a tutorial ) to subclass the listbox class, but I was able to intercept only mouseclicks, not the...
1
2006
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 of the datagrid that will do this?
2
1550
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? Can you tell me how to fix it? Thank you for any assistance.
16
2558
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
6684
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
2859
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 message in a mobile device.With in the given view area if the whole message does not fit,we need to provide the ability for users to scroll through the entire message using pageup/pagedown or key up and key down.In our case we have the whole...
9
3395
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 message in a mobile device.With in the given view area if the whole message does not fit,we need to provide the ability for users to scroll through the entire message using pageup/pagedown or key up and key down.In our case we have the whole...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.