View Single Post
Old Dec 26th, 2006, 6:01 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
javascript Syntax (Toggle Plain Text)
  1. window.onkeypress = function(event) { return event.keyCode != 8; }
This binds the onkeypress event to a function that returns false if the keyCode is equal to 8 (which is backspace). Returning false on an event usually (always?) makes the browser ignore any further consequences of the event.
Arevos is offline   Reply With Quote