Live Telephone Number Validation | JavaScriptSource

Live Telephone Number Validation

Rob Sheldrake Mar 23, 2007

General

Simple telephone number validation. This script makes sure the user enters only numbers, brackets, hyphens, or spaces. A plus (+) may be entered as the first character. Just add it to your form validation routine.


Notes

Implement with onkeyup="validatephone(this);" on desired field

Add any symbols after the '@' symbol in the line of characters to block characters such as brackets

Source Code

Paste this source code into the designated areas.

External file

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


Head

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


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(5 comments)

Thanks for sharing this.

suneel Oct 12, 2007

thats a nice code thanks dude.... :-)

lakshmi Sep 26, 2007

Its really helpful man... thank you..:-)[br /] Keep going...

raghunandan Jul 31, 2007

Hi.. it is very nice man, keep it up... It helps really helps for me a lot.[br /][br /]Thank you,[br /]Reddy Prasad

Reddy Prasad Jul 12, 2007

Great stuff,and very useful to me

Mujeeb Rahman Apr 1, 2007