BoostSolutions

1. Product Description

SharePoint Form Validation provides standard validation methods such as Require, Regular Expression, Range, Compare, when you create or edit a list item in a form. The instruction will show you how to use the SharePoint Form Validation.

2. Configure Form Validation Settings

The following is an Orders list in the site.

On the Settings menu, select List Settings. Click Form validation settings under Permissions and Management group.

The Form Validation Setting page:

Click "Buyer" column. In the configuration page, select "Required Field Validator" checkbox, and type Error Message, then click "OK". It will display the error message when you input nothing on the column.

Next configure the Order No. column.

Select "Regular Expression Validator" checkbox, enter the expression "\d{4}-\d{3}-\d{4}" and error message. When user's input value does not match with the expression, the error message will display.

Next configure the Product column.

Select "Required Field Validator" checkbox, type the error message, and click "OK".

Next configure the Quantity column.

Select "Range Validator" checkbox, and choose "Type". Specify the minimum value, maximum value and error message. When entered value is not in the range, a piece of error message will remind you.

Next configure the E-mail column.

Select "Regular Expression Validator" checkbox, and click search button. In Regular Expression Editor dialog, select the “Internet e-mail address” expression.

And then type the error message, and click "OK".

Next configure the Order Date column.

Select "Required Field Validator" checkbox, type the error message, and click "OK".

Next configure the Remittance Date column.

Select "Compare Validator" checkbox. And select Equal or Greater Than in "Operator" dropdown list, and select "Order Date" in "Column To Compare" drop-down list.

(This setting means the Remittance Date must be equal to or greater than the Order Date, or else there will be an error notification displayed in the edit form or new form.)

3. Create a New Item to Test the Form Validation Settings of the List

If the contents inputted are not in accordance with settings configured before, error messages display as bellow.

Following picture shows the result if all the validation has been passed.

Real Time Web Analytics