Tip: Prevent non-integer input
<<Certain gadgets, such as calculators or leap year finders, should restrict user input to integer values. To detect when the user starts entering non-integer data into an element such as an edit area, you can use an onkeypress handler: function onKeyPress() { var a = editbox.value; if (a*…>> (more…)
See original post by Chris Gilmer