Validating a List Column
In this walk-through, you will learn how to enable validation on a custom list column. This walk-through will add validation to the Birthday list column added in the previous walk-through.
- Configure validation on the Birthday column within the Demo List.
- Select the Demo List from the Quick Launch menu if you are not already on the list.
- Click the List tab at the top of the list's page to open the List toolbar.
- Click the List Settings button on the List tab toolbar to navigate to the list settings page.
- Click the Birthday link within the Columns region to navigate to the column settings page.
- Expand the Column Validation region within the column settings page and enter =[Birthday]<Today() in the
Formula field and The birthday must be earlier than the current date. in the User message field.
The formula in this example will ensure that the user cannot enter a date that is the same as or after the current date.
- Click the OK button to save the changes.
- Test the new column for validation.
- Select the Demo List from the Quick Launch to navigate back to the main browse view of the list.
- Click the new item link within the Demo List to create a new item.
- In the required Title field, enter "Testing" and select a future date in the Birthday field.
- Click the Save button. You should get a validation error message similar to the following image:
If you did not get an error message, go back and check our column settings validation formula and make sure it was typed in correctly.
- Change the Birthday date field to a date earlier than the current date and click
the Save button. The new item should be saved and displayed in the list.