Example #1: Demonstrates onkeypress for only allowing numbers in field using recommended technique for registering events

Numbers Only:     


Example #2: Using In-line javascript is simplier, but blurs structure and behavior

Age:

---Messages for both examples follow---