Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

again a beginner's question????

good methods to force a ###-##-#### for SSN and ###-###-#### for phone numbers on layout

i'm sure you all have a bunch of answers, but i am a beginner

i thank you in advance

Posted

I put 2 fields on top of each other...

top field with opaque background, not selectable in browse mode to display

the result (say a text field with a calculation that formats the phone number

like you want wtih the "(" etc.).

an the bottom field (a number only field) to take the user input in browse mode.

Base on what the user enters your calculated top field will convert and display

in the desired color & format all based on your calculation.

Good luck

--Dan

Posted

With 7 you can now have an auto enter calcualted field that will update after the first instance of entering. This enables you to reformat a field to whatever you wish it to contain.

This is great for phone number and social security formatting amongst other things.

Simply create a text field for your phone number and then apply an auto enter calculation, something along the lines of:




    /* The Let () function allows us to create a variable for use within a calculation */



Let (

 [  PhoneNumber=Filter ( Current Field Name Here; "0123456789") ];

      /* The filter removes all extra characters, leaving just the numbers */ 



      /* Reformat the number now, adding in the extra characters */



   Left(PhoneNumber; 3) & "-" & Middle(PhoneNumber; 4; 3) & "-" & Right(PhoneNumber; 4)

      )



After you click ok, uncheck the box underneath the auto enter calc value so that the field will update itself when the contents are changed.

This now saves on any extra "display" fields and the user does not get confused when they click in the field and the format changes. They can enter the phone number how ever they want, but it will update to your format when they leave the field. If they click back in the field, what they see is what they get.

This topic is 7333 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.