• testing for length of field value

    By Paul Davies 2 decades ago

    I have a text field that must be entered and must be 13 characters long.



    I have used the following validation script…



    Set field = New FieldValidator("EAN", "EAN is required.")

    Call field.AddFormula( {@Length(@ThisValue) != 13}, "EAN must be 13 characters long." )

    Call validator.AddField(field)



    The validation works OK if the field is empty, but I cannot get it to trigger if the length of the field value is wrong. It is late and I am tired - what am I doing wrong!! :)