This project is read-only.

SharePoint Validator requires jQuery. The current version was built against jQuery 1.3.2, but should work with all versions thereafter, and possibly some versions prior.

Download the latest edition of SharePointValidator.js and install the file somewhere accessible to your SharePoint Server along with the latest jQuery library.


In order to use SharePoint Validator on NewForm.aspx or EditForm.aspx pages, go to the NewForm.aspx page for the list you would like to use, and add ?toolpaneview=2 after the URL.

For example, if your list URL to add a new item was you would add ?toolpaneview=2 after the URL, so your entire URL to load would be

After loading this page you will have the ability to add a new Web Part to the page.

Click the "Add a Web Part" link, and add a Content Editor Web Part to the page.

Select edit -> Modify Shared Web Part.

Click "Source Editor..." to open a source view for the Content Editor Web Part.

Paste the following in this field:

<script type="text/javascript" src="\path\to\jquery.min.js"></script>
<script type="text/javascript" src="\path\to\SharePointValidator.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var validator = new SharePointValidator();
validator.addRequired("First Name");
validator.addRequired("Last Name");

validator.addPhoneNumber("Phone Number");
validator.addPhoneNumber("Fax Number");


validator.addEmailAddress("Email Address");

$("input").blur(function() { validator.validate(); });

This will load jQuery, SharePointValidator, and add the fields to be validated.

The blur() event tells it to re-validate each time a field is left. This can be altered so you can validate on any event as desired. The second call to validate() tells it to immediately validate the form upon loading.

Please note that validator will also automatically disable the OK button until all fields are properly input.

Another important thing to note is that any EmailAddress, Zip Code, or Phone validation automatically adds the input to the Required validation fields as well. So explicitly calling .addRequired() to any regex validation is not required.

For further information, you may contact Tom via Twitter at @nerdyhearn or via his website at

Last edited Feb 2, 2010 at 3:25 PM by nerdyhearn, version 1


No comments yet.