Hi guys,
It took me forever to find this, so I figured I would post it here for the next poor soul who is wanting this:
The issue I faced in SP 2010 was that I wanted my users to enter 9 numbers in a SSN field without having to worry about entering hyphens. Once the entry was made, I wanted the SSN's on the list to appear hypehnated, though.
Here's how it was done:
First, open the list in InfoPath 2010. Then select the SSN field and then the control tools box. Click default value. Then select the fx button and enter this formula:
concat(substring(translate(., "-", ""), 1, 3), "-", substring(translate(.,
"-", ""), 4, 2), "-", substring(translate(., "-", ""), 6, 4))
Publish and you're done :)
-Dudley