How do I make an input box accept numbers only?

They can and they can also get to negative numbers as well.