Friday, August 27, 2010

Validating special column types in SharePoint 2010?

How to validate special column types, e.g. phone, e-mail etc in SharePoint 2010?

Basic SharePoint 2010 field validation
One could use an ASP.NET RegularExpressionValidator but surely there must be a simpler way? There isn't really an easier way. Alternative ways might exist though.

If we want to compare values of one column to another or if you want very basic validation you can use Column Validation, but it doesn't support regular expressions so it won't help with things like email.
You could use jQuery to do the validation, which is a bit easier than using a validator, although it only checks on the client side.

Another option if you have the Enterprise version of SharePoint is to use InfoPath to edit the list. With InfoPath you can easily add regex validation.


No comments: