How do you restrict a field to contain alphanumeric characters only?

Author: Tripp W Black

Created: 08/26/1999 at 07:51 PM

 

Category:
Notes Developer Tips
Formulas

How do you restrict a field to contain alphanumeric characters only?

This is an example of code that uses regular expressions to limit a field's entry. Put this in a field's Input Validation formula:

@If(
@Matches(Serial_Num; "+{0-9}"); @Success;
@Matches(Serial_Num; "+{a-zA-Z}"); @Success;
@Do(@Prompt([OK]; "Invalid Serial Number"; "The Unit Serial Number contains an illegal character, probably a carriage return. Please remove the illegal character and save again."); @Return(""))
)


previous page