I have an html form input which I need to test for a valid numeric entry. Currently, all other data validation is being done at the top of my form post page before the entries are submitted the the database (ASP). In one case, I'm using the subroutine below for an alpha-numeric entry which has a specific length anf format; maybe there's a variation that would allow me to specify only numeric format/datatype, but allow any length?
Function InputMask(Recnum)
Dim sln
Set sln = new RegExp
sln.IgnoreCase = false
sln.global = false
sln.Pattern = "^[0-9][A-Z][A-Z][A-Z][0-9][0-9]$"
InputMask = sln.Test(Recnum)
End Function
If Not InputMask(Recnum) Then Response.Redirect ReDir2
End If
Function InputMask(Recnum)
Dim sln
Set sln = new RegExp
sln.IgnoreCase = false
sln.global = false
sln.Pattern = "^[0-9][A-Z][A-Z][A-Z][0-9][0-9]$"
InputMask = sln.Test(Recnum)
End Function
If Not InputMask(Recnum) Then Response.Redirect ReDir2
End If