Home > SharePoint 2010 > UK Phone numbers in InfoPath 2010

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)

image

I then created a validation rule for the PhoneNumber control, for the condition I used “PhoneNumber” “does not match pattern”

image

and selected “Select a pattern…” in the final box, this brings up the Data Entry Pattern dialog box.

image

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.

image

With the addition of a screen tip  the validation rule is complete

image

About these ads
Categories: SharePoint 2010 Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 245 other followers

%d bloggers like this: