Numbers Only | JavaScriptSource

Numbers Only

JavaScriptSource Staff Dec 7, 2007


Use this script to restrict the user from entering anything but numbers in a form field.

U.S. Zip Code:


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: numbersOnly.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


I don't know what you mean.

Lee Underwood Jan 29, 2008

Due to the limitations of these comments, you will need to submit your question to the [a href=""]JavaScript Forum[/a] for further help.

Lee Underwood Jan 29, 2008

Yip ![br /]This is a new approach of what I submitted before... I like it because it doesn't even allow to type the letters in.

MANZI Olivier Dec 10, 2007

this does not work[br /][br /]I get an object expected error and I copied everything exactly

me Dec 9, 2007

I don't want what the "event" is? Could you tell me more?

Thanh TUng Dec 9, 2007