...

View Full Version : Validating beginning number for a data entry



florida
12-22-2003, 06:17 PM
Anyway to put out an message to validate if a number entered has a zero as a first number?

So if someone enter the number:
23
it would be okay.

If someone entered:
60
it would be okay.

But if someone entered a number:
03
it would give an alert message saying it doesnt like the number beginning with a zero.

I tried this and it is not working:


var zeroRegEx = /^0/;

if(zeroRegEx.test(document.indexpage.fieldhere.value))
{
alert("Do not enter a number beginning with a zero.")
}

Willy Duitt
12-22-2003, 06:52 PM
Don't forget to check here (http://www.webxpertz.net/forums/showthread.php3?s=&postid=147692#post147692). :rolleyes:

.....Willy

florida
12-22-2003, 08:19 PM
Thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum