Validate Forms

How do you validate that a user has entered a number into an input box, such as a telephone number, or an imperial weight?

Thanks in advance