UK Phone numbers in InfoPath 2010
I was working with a client recently who wanted to be able to submit InfoPath forms with a UK style phone number field of 5 numeric+space+6numeric format, ‘01234 123456’.
I had to do a fair amount of looking around in InfoPath and the web , but finally came across a quite neat solution of pattern matching.
Firstly I had to make the text box accept the data type Text (string)
I then created a validation rule for the PhoneNumber control, for the condition I used “PhoneNumber” “does not match pattern”
and selected “Select a pattern…” in the final box, this brings up the Data Entry Pattern dialog box.
From this you can now choose “Custom pattern” I used pattern \d\d\d\d\d \d\d\d\d\d\d to format my input.
With the addition of a screen tip the validation rule is complete