7 Replies Latest reply on May 27, 2010 9:38 AM by RickWhitelaw

    Input masks for Phone Numbers

      Title

      Input masks for Phone Numbers

      Post

      I am new to FileMaker and want to put in an input mask(what we call it in access) for SSN and Phone#'s so the user does not have to put in dashes or parenthesis or dashes when entering a phone no. (601)999-9999 or SSN 999-99-9999.  How do you do this in Filemaker Pro 10? 

        • 1. Re: Input masks for Phone Numbers
          philmodjunk

          You don't have an input mask so to speak but you have an option that achieves nearly the same result.

           

          You can set up an auto-entered calculation that first strips out any characters other than 0...9 and then inserts the desired characters and/or spacing at the correct points.

           

          Let ( string = filter ( self ; "0123456789" ) ; If ( length ( string )  = 7 ,  Left ( string ; 3 ) & "-" & Mid (string; 4 ; 2 ) & "-" & Right ( String ; 4 ) ; Self )

           

          Is an expression that will filter out all non numeric characters, then inserts dashes at the appropriate location to format an SSN. If there aren't enough digits entered, this expression leaves the data as entered.

           

          oh yes, and you'll want to clear the "do not replace existing values..." option as well.

          • 2. Re: Input masks for Phone Numbers

            Thanks Phil! Sounds like this will work. I am new to this forum. Are you pleased with the level of expertise in here or are you a member of any other groups for Filemaker ? I just upgraded from FM 10 Pro Advanced to FM 11 Pro Advanced. So, I may have more questions!

            Thanks,

            Joanne

            • 3. Re: Input masks for Phone Numbers
              ccarr

              I put this calucation in for my phone number and I receive the message:  "Too few parameters."  What am I doing wrong?  (Filemaker 11)

               

               

              Let ( string = Phone Number ) ; If ( length ( string )  = 7 ,  Left ( string ; 3 ) & "-" & Mid (string; 4 ; 3 ) & "-" & Right ( String ; 4)

              • 4. Re: Input masks for Phone Numbers
                philmodjunk

                You've got a parenthesis in the wrong place. Change:

                 

                Let ( string = Phone Number ) ; If ( length ( string )  = 7 ,  Left ( string ; 3 ) & "-" & Mid (string; 4 ; 3 ) & "-" & Right ( String ; 4)

                 

                To:

                 

                Let ( string = Phone Number ; If ( length ( string )  = 7 ,  Left ( string ; 3 ) & "-" & Mid (string; 4 ; 3 ) & "-" & Right ( String ; 4) ) )

                 

                 

                • 5. Re: Input masks for Phone Numbers
                  ccarr

                  Thanks.

                  • 6. Re: Input masks for Phone Numbers
                    RickWhitelaw

                    I use this as a custom function:

                     

                    Case(  Length ( Filter (input ; "0123456789" ) )   < 10  and Left (input; 1 ) ≠ "+"; "Enter 10 digits!";Length ( Filter (input; "0123456789" ) )   = 10; "(" &  Left ( Filter ( input; "0123456789" ) ; 3 ) & ") " & Middle ( Filter ( input; "0123456789" ) ; 4 ; 3 ) &"-" & Middle ( Filter ( input;"0123456789" ) ; 7 ; 4 );input )

                     

                     

                    "input" is the variable for the custom function and is the phone number. It forces 10 digits except in the case of overseas numbers and returns the phone number in the format (111)111-1111

                     

                    RW

                    • 7. Re: Input masks for Phone Numbers
                      RickWhitelaw

                      I should add that I call this function Phone Format and that it's used as an auto-enter calculation. Syntax: Phone Format(self)

                       

                      RW