Jump 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.

New, Lkg for info format phone # inf field

Featured Replies

  • Newbies

I am having trouble formatting a phone number field to display the phone number as (000)000-0000, I would also like an error message to display if an incorrect number of digits are entered. Wasn't sure to do it as calculation or number field, etc cannot find options nor sure of the code to format it this way.

Any help would be greatly appreciated!! it is currently defined as a number field.

The phone number should be a text field. It is not a number, i.e., 5*Phone Number + 3 does not have any meaning.

In pre FMP7 a calculated text field was placed on top of the entry field. The calculated field would then show the formatted phone number. you might try a calculation like this:

Phone = Subsitute (Subsitute (Subsitute (Subsitute( "-", "")), "(", ""), ")", ""), "(", "")

Case ( Lenght (Phone) <> 10, "Enter 10 digit phone number",

"(" & Left ( Phone, 3) & ") " & Middle (Phone, 4, 3) & "-" & Middle (Phone, 7, 4))

You could also use a trigger field of Left( GetField("Phone Number"), 0 ) & serial, and a self-relationship from trigger to serial, then make the Phone Number a lookup to the calculation field, based on the self-relationship. This would overwrite the entered number with the formatted one without requiring field stacking to create the mask.

A little tweak to Ralph's calc, adding the substitution for a space and fixing a couple of typos:

Case( Length(Substitute( Substitute( Substitute( Substitute( Substitute( phone, "-", "" ), " ", "" ), "(", "" ), ")", "" ), "(", "" )) <> 10, "Enter 10 digit phone number",

"(" & Left( Substitute( Substitute( Substitute( Substitute( Substitute( phone, "-", "" ), " ", "" ), "(", "" ), ")", "" ), "(", "" ), 3 ) & ") " & Middle( Substitute( Substitute( Substitute( Substitute( Substitute( phone, "-", "" ), " ", "" ), "(", "" ), ")", "" ), "(", "" ), 4, 3 ) & "-" & Middle( Substitute( Substitute( Substitute( Substitute( Substitute( phone, "-", "" ), " ", "" ), "(", "" ), ")", "" ), "(", "" ), 7, 4 ) )

Create an account or sign in to comment

Important Information

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

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.