Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Verify length of the contents of a field

Featured Replies

Hello,

This should be fairly easy but running into problems.. field remains blank.

What I'm trying to is to confirm that the contents (a number) entered into a field is of certain length and if not return a text error message.

Here is what I thought might work...

If (Length(Field_name = 16); ""; "Please confirm the number")

Is there something I may be overlooking and if so, can you point me in the right direction?

TIA.

Jack

Where are you putting this calculation: in the field's validation options?

Is the field of type text or number?

  • Author

Vaughan,

Using the calculation under the field validation options; the type of field is a number ( as in credit cards).

HTH.

Jack

If it's a number then don't validate it as text, use a numerical range instead in the "within rage" option...

1000000000000000 to

9999999999999999

Note that this won't work if you expect the number to contain leading zeros; FMP will strip off the leading zeros in a number field (because numbers don't have leading zeros). In this case, DO use a text field to store the "number" (it's really a text string) and use the calculation

Length( field ) = 16

You could get fancier and filter out all non-numeric characters in the validation calculation too.

The validation message does not go into the validation calculation itself; it goes into the "display a message" panel at the bottom of the dialog.

Lastly, note that validation occurs when the record is committed, not when the field is exited.

  • Author

Hi Vaughan!

Thanks for the update; I had just finished up tinkering with the field definition just prior to reading your response and they are equivalent. Everything works as planned =)

Thanks for your assistance.

Jack

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.