E
Eugene Anthony
Bellow are two functions that I use to validate my zipcode and telephone
number:
function isInt(input)
on error resume next
Dim Temp
Temp = Clng(input)
isInt = (err=0 and inStr(input,".") = 0)
on error goto 0
end function
function isPhone(input)
Set re = new RegExp
re.Pattern = "[\s\-\(\)\+]"
re.Global = true
isPhone = (isInt(re.replace(input,"")))
end function
function isZip(input)
Set re = new RegExp
re.Pattern = "[\s\-]"
re.Global = true
isZip = (isInt(re.replace(input,"")))
end function
Are these functions considered to be feasible for validation?.
Your help is kindly appreciated.
Regards
Eugene Anthony
number:
function isInt(input)
on error resume next
Dim Temp
Temp = Clng(input)
isInt = (err=0 and inStr(input,".") = 0)
on error goto 0
end function
function isPhone(input)
Set re = new RegExp
re.Pattern = "[\s\-\(\)\+]"
re.Global = true
isPhone = (isInt(re.replace(input,"")))
end function
function isZip(input)
Set re = new RegExp
re.Pattern = "[\s\-]"
re.Global = true
isZip = (isInt(re.replace(input,"")))
end function
Are these functions considered to be feasible for validation?.
Your help is kindly appreciated.
Regards
Eugene Anthony