Wednesday, 28 January 2009

InfoPath Rules DataValidation

If you have an Control, ex. a TextBoxt you can validate the text using a pattern.

Todo:
  1. Doubleclick on the TextBox or left click and choose Options
  2. Click DataValidation
  3. Click Add
  4. In the first dropdown select the TextBox (selected as default)
  5. In the second dropdown select "Does not match pattern"
  6. In the third dropdown select Userdefined pattern and enter the pattern.

Here is a growing list of patterns.

Email: (\p{L}+_*-*\p{L}*\d*\.?)+@(\p{L}+-*\p{L}*\.?)+
It's not perfect, because it allows a.b.@c.com and a.b@c.com., but it does allow a.b.c@d.com and a.b@c.subdomain.com

No comments: