If you want to create a Telephone format on a infopath form :
1. Add a text field to the form (Even if it is the list or a blank form)
2. Select the text box and click on Manage Rules
4. Add a rule to your textbox control with the following conditions (make sure to select "and" operator):
a. field "does not match pattern" Phone number
b. the expression: string-length(translate(., "()- ", "")) = 10
c. the expression: string-length(translate(., "()- 0123456789", "")) = 0
5. Add action to the rule:
a. Set a field's value
b. Select your textbox field
c. Insert formula for the value (click the fx button): concat("(", substring(translate(., "()- ", ""), 1, 3), ") ", substring(translate(., "()- ", ""), 4, 3), "-", substring(translate(., "()- ", ""), 7, 4))
Link for the detailed explanation : http://digitalmacgyver.wordpress.com/2012/02/02/custom-rule-for-telephone-field-in-infopath-201-form
1. Add a text field to the form (Even if it is the list or a blank form)
2. Select the text box and click on Manage Rules
4. Add a rule to your textbox control with the following conditions (make sure to select "and" operator):
a. field "does not match pattern" Phone number
b. the expression: string-length(translate(., "()- ", "")) = 10
c. the expression: string-length(translate(., "()- 0123456789", "")) = 0
5. Add action to the rule:
a. Set a field's value
b. Select your textbox field
c. Insert formula for the value (click the fx button): concat("(", substring(translate(., "()- ", ""), 1, 3), ") ", substring(translate(., "()- ", ""), 4, 3), "-", substring(translate(., "()- ", ""), 7, 4))
Link for the detailed explanation : http://digitalmacgyver.wordpress.com/2012/02/02/custom-rule-for-telephone-field-in-infopath-201-form
This is one is for the Zipcode + 4 (relatively the same if you compare it)
ReplyDeleteZipcode + 4 for a text box on infopath form
If you want to create a Zipcode + 4 format on a infopath form :
1. Add a text field to the form (Even if it is the list or a blank form)
2. Select the text box and click on Manage Rules
4. Add a rule to your textbox control with the following conditions (make sure to select "and" operator):
a. field "does not match pattern" Zipcode + 4
b. the expression: string-length(translate(., "()- ", "")) = 9
c. the expression: string-length(translate(., "()- 0123456789", "")) = 0
5. Add action to the rule:
a. Set a field's value
b. Select your textbox field
c. Insert formula for the value (click the fx button): concat( substring(translate(., "()- ", ""), 1, 2), substring(translate(., "()- ", ""), 3, 3), "-", substring(translate(., "()- ", ""), 6, 4))
Will this work on office 365 w/Sharepoint 2013?
ReplyDeleteyes
DeleteSuper-Duper site! I am Loving it!! Will come back again, Im taking your feed also, Thanks. 0800 mobile numbers
ReplyDeleteStep 4 should possibly read "Add an action rule.."
ReplyDeleteWorked great - thanks