Need help formatting zip codes and phone numbers

  • Thread starter michael_oneill_
  • Start date
M

michael_oneill_

Need help / pointers on how to format US zip codes and phone numbers.

Thanks

Michael
 
M

michael_oneill_

Need help / pointers on how to format US zip codes and phone numbers.
These will be stored in the database as one long string but when the
data is pulled back, I want them to be formatted. Same goes for data
entry, format valid zip code and phone number, otherwise leave it as
is.
 
S

steve


it should work something like this:

set up two fields: one hidden that will contain the phone number
being pulled from the database - hide this field.

add a function to the default value of the other field that will be
used to display the telephone number like you want it. the function
should look something like:

concat("(", substring(field16, 1, 3), ") ", substring(field16, 4, 3),
"-", substring(field16, 7, 10))

(field16 is the hidden field)

this might not fit exactly your circumstance, but it should point you
in the right direction...


this article is related to what you want to do.

read this article....

http://enterprise-solutions.swits.net/infopath/auto-format-time-on-lostfocus.htm


steve lescure
 
M

mike_ni

concat("(", substring(field16, 1, 3), ") ", substring(field16, 4, 3),
"-", substring(field16, 7, 10))

(field16 is the hidden field)


tried this but all Im getting out is a load of brackets

(((()()( )( )

for:

concat("(", substring(../@PhoneDisplay, 1, 3), ")", substring(../
@PhoneDisplay, 4, 3), " ", substring(../@PhoneDisplay, 7, 4))

anyone else? ;-(
 
Top