Validation - Lakelands Computing

Title
Go to content
Data Validation
Validation is limiting or restricting the data allowed. It is checking that the data meets certain criteria. It is NOT checking if the data is correct (that is Verification) - just if it is allowed. There are several types of validation:

Range check
This checks to see if the value is between two numbers eg a range check for age might be 0 - 125

Presence check
This checks to see if a value is present, if anything has actuall been entered. You see this a lot of sign up forms on the web

Length check
This checks to see if there are enough characters, if the data is the allowed length, a good example of this is a password which has to be more than 8 characters.

Format check
This checks if the data is in the right format, for example a date, or something being an Integer

Look up check
This checks if the data is one of the acceptable values that it has been given. A good example of this is clothes sizes. The look up table would have "s"or "m" or "l or ,"xl" or "xxl". When data is entered it would check to see if it was one of these values

Check Digit
This is the most complex type. It is used to check if numbers have been entered correctly. They typically work with a digit being added to the end of each number (these extra digits are calculated based on the number itself). If it is correct when the data is checked then the chances are the number was correct entered.

Simplified Worked example:
original number: 332
check digit: 8  (3+3+2)
number to be entered: 332 8

by checking the first three digits add up to the fourth one (eight) the computer knows it is probably correct.
All Text copyright Lakelands Academy & Mr T Purslow 2020.
All images copyright free / creative commons unless otherwise stated.
You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
Back to content