I want to only allow numbers (0-9) to be entered into a textbox. I am just testing some code, but i discovered that pressing numbers on the numerical pad on the keyboard creates different keycodes than using the ordinary numbers on a keyboard. Why is this? Also when i use String.fromCharCode(keyCode), and press a letter, the capital of that letter appears, and say if pressing the single quote key, i get a completely different character from it. Whats going on?