InfoPath - insert hypens automatically into Social Security Number

M

mikew

Hi,

I'm trying to make a Social Security Number field in which the user can type
123121234 and upon exiting the field, the field automatically inserts hyphens
so that it becomes 123-12-1234. How do I do this? The Social Security
Number pattern in rules limits the user to having to insert hyphens
him/herself. I want this done automatically. How do I do this? Thanks.
 
C

Clay Fox

Hey Mike.

Add a rule to your field.
Make the condition does not match pattern and select SS#. This way if it is
entered correctly it will be left alone.
Then for the action hace set field value pointed at itself.
Enter this formula.
concat(substring(., 1, 3), "-", substring(., 4, 2), "-", substring(., 6, 4))
This will insert the dashes.


--
Thanks

Clay Fox

Qdabra Software
http://www.qdabra.com

InfoPathDev.Com
The Largest InfoPath Forum in the World
http://www.infopathdev.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top