Hello,
the following validation is giving me problems when it checks for the number of numbers entered in the phone field. The script checks first to see if the field is not empty, then checks to make sure its numeric. both seem to work fine. the next if statement checks to make that there is at least 10 numbers. which i can't get to work. what I am trying to achieve is to generate an error if less then 10 numbers are in the field. the max length is controled by the input form.
Sub Check_Phone(fvalue,dname)
If (fvalue) = "" then
ErrCount=ErrCount+1
AddErr(Cstr(ErrCount) + ". "+ dname+ " cannot be empty"
else
If IsNumeric(Trim(fvalue))=False Then
ErrCount=ErrCount+1
AddErr(CStr(ErrCount) + ". " + dname + " is not a valid Number"
else
if len(fvalue) < 10 then
ErrCount=Errcount+1
AddErr(CStr(ErrCount) + ". " + dname + "doesn't appear to be a valid phone no."
End IF
End If
End If
End Sub
any help or recommendations would be appreciated
the following validation is giving me problems when it checks for the number of numbers entered in the phone field. The script checks first to see if the field is not empty, then checks to make sure its numeric. both seem to work fine. the next if statement checks to make that there is at least 10 numbers. which i can't get to work. what I am trying to achieve is to generate an error if less then 10 numbers are in the field. the max length is controled by the input form.
Sub Check_Phone(fvalue,dname)
If (fvalue) = "" then
ErrCount=ErrCount+1
AddErr(Cstr(ErrCount) + ". "+ dname+ " cannot be empty"
else
If IsNumeric(Trim(fvalue))=False Then
ErrCount=ErrCount+1
AddErr(CStr(ErrCount) + ". " + dname + " is not a valid Number"
else
if len(fvalue) < 10 then
ErrCount=Errcount+1
AddErr(CStr(ErrCount) + ". " + dname + "doesn't appear to be a valid phone no."
End IF
End If
End If
End Sub
any help or recommendations would be appreciated