In this post we will discuss how we can do zip code validation in Infopath 2010 in SharePoint 2010. Before this you can also check for email id validation
in infopath 2010 and phone number validation
in InfoPath 2010. Also you can check my previous posts on:
Follow below steps for Mobile number validation in infopath 2010:
1. Add a textbox to the infopath form.
2. Select the textbox and click on Manage Rules, then from the Rules window Select New -> Validation.
3. Give a name in "Details For", here we have given rule as "Rule for Zip Code Validation".
4. Now click on the condithin None, this will open the Condition dialog box, Here First select the control and 2nd Select "does not match partten" and in the 3rd click on Select a partern as shown in the fig below:
5. This will open the "Data Entry Pattern" where you can select based on the custom pattern or also you can define a custom pattern as shown in the fig below:
6. Now the condition dialog box should look like below:
7. Now save and publish the form.
8. Now if you will not enter zip code in correct format, then it will show error message.