Field validation in script library vs. input validation event of field

Field validation in script library vs. input validation event of field

This may be more of a preference or a philosophical issue than a question, but I am trying to weigh the pros and cons of doing all field validation in a script library called during a QuerySave event vs. in the input validation event of a field.

Both methods have several advantages and disadvantages -- i.e., script validation in QuerySave/Script Library, "centralized validation code" in script library, flexibility and complexity of Lotus Script validation, ability to turn off all validation during testing/coding by remarking a single line, traditional validation formula, simplicity of formula language, native support of validation by the Notes UI, evaluates during refresh as well as save, ease of troubleshooting code....

So, you can see how I am going back and forth. Do you have any insight?

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

I prefer to use the querysave single module validation approach for the user experience. If you have 25 fields to validate and the user has 25 invalid entries, they will need to attempt to save the document 26 times before it is correct. I wouldn't complete the form after my third try.

A single validation event allows you to present the user with all of the validation errors at one time. In a number of applications, we have set indicators near fields with invalid values with details on why the validation error occurred, as well as a consolidated list of all validation errors on the form.

Do you have comments on this Ask the Expert question and response? Let us know.

This was first published in November 2004