• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 17. Using FileMaker 5.5's New Fe... > Validating by Number of Characters

Validating by Number of Characters

Some data, like phone numbers or social security numbers, must always be the same number of characters. But when users make simple errors—like adding hyphens in a phone number, for example—they often don't know that they've done anything wrong. In “Creating Field Masks” in Chapter 3, we showed you how to create a field mask to format a phone number field. In order for the mask to work properly, the user must not enter more than 10 digits. In previous versions, to enforce this limit you needed to write a calculation using the Validated by Calculation option in the Validation tab in the Field Options dialog box. FileMaker 5.5 provides a much more convenient method.

To validate by number of characters:

Open a file with a phone number field whose length you want to limit.

We use the same file we worked with in “Creating Field Masks” on page 43 (Figure 17.1).

Figure 17.01. Open the file whose phone number field you want to change.

Choose File > Define Fields (Ctrl+Shift+D/Command-Shift-D).

When the Define Fields dialog box appears, double-click the Phone field.

When the Options dialog box appears, click the Validation tab.

Check the Maximum number of characters check box and enter 10 in the box to the right (Figure 17.2).

Figure 17.02. In the Validation dialog box, enter the maximum number of allowed characters.

Click the Strict: Do not allow user to override data validation check box (Figure 17.3).

Figure 17.03. To restrict the user from overriding the validation alert, check the Strict option.

If you want a custom message to display when the user enters more than 10 characters, click the Display custom message if validation fails check box and type the message in the box below (Figure 17.4).

Figure 17.04. You can enter a custom message that will display if the user enters more than the specified number of characters.

Click OK and then Done.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint