thanks for the code but it had a small bug in it which was when you press 2 keys very very fast it will capture 1 of them and the other just be ignored, I am personally using it to disable the Fx keys and the arrow keys etc... letting the user use only the alphanumeric keys...

here is what I did
Code:
<script language="JavaScript">
	<!--
	function keyHandler(e) {
		var pressedKey;
		if (document.all)	{ e = window.event; pressedKey = e.keyCode; }
		if (document.layers || e.which) { pressedKey = e.which; }
		if (!pressedKey) { return false; }
	}
	
	document.onkeypress = keyHandler;
	-->
</script>
I added the comment tags cause in IE 5 it sometimes prints out the code so using those will make it think it's a comment so it will just be ignored :P

tnx alot for the code you gave out here, you really helped me and also thnx to pradeep for telling us how to make it work with FF too

hope what I did helps you as much as what you did helped me

Last edited by shabbir; 31Mar2009 at 07:36.. Reason: Code blocks