I am using following javascript code which I think should only allow numbers, backspace, delet, left arrow and right arrow keys in textbox, but it is also allowing alphabets. I
No doubt your code is correct but you missed "return" keyword in textbox.
You can see the code here