Jump to content
Server Maintenance This Week. ×

Phone number formatting


This topic is 8731 days old. Please don't post here. Open a new topic instead.

Recommended Posts

This is for FMP 5. I'm not sure if it applies to lower versions.

If you want to force proper formatting for telephone number so that they appear as: (555)888-9999, but you don't want to make the user enter the paraentheses and hyphen every time this how to do it.

You need two fields, a text field and a calculation field.

The idea is that the user enters the phone number into the text field as a string: 5558889999. The calculation field takes this string of numbers and inserts the formatting. The calculation field is placed ontop of the text field so that when the user, after entering the string, tabs ot of the field all they see is the calculation field.

Okay here are the steps.

1. Create a text field and a calculation field (I'll call them Phone and PhoneCalc)

2. Set the calculation field = "(" & Left(Phone,3) & ")" & Middle(Phone,4,3) & "-" & Right(Phone,4).

Note: If the phone numbers in your country have a slightly different format change the above index values.

3. Place the fields on the Layout where you want them to appear, so that the PhoneCalc field is directly ontop of the Phone field. Format the PhoneCalc field to have a white background ,or whatever the background colour of your layout is. Select the background colour from the colour palette in the fill controls on the left side bar. This is done so that the field underneath is not visible once it has been tabbed out of.

Set the PhoneCalc Field format no to allow entry.

4. Go to browse mode and try it out. Make sure that your field is long enough to display the number with the additional formatting.

Note: The Phone field has not been changed so it is still searchable as 5558889999 or a substring.

5. Repeat these steps for each phone number field. Sorry it's so long, but there is no built in formatting capability that I have been able to find.

Have fun,

Louisa

Link to comment
Share on other sites

  • 4 weeks later...

This topic is 8731 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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