What is validation?

 

People can sometimes enter the most awful rubbish into computers. Validation is the name for the checks that detect incorrect data, display an error message and request another input or just reject the data.   Each bar code that is scanned at a supermarket is validated before being added to your receipt.   Sometimes there's a warning beep that tells the checkout operator to re-scan. Validation stops people entering silly or incorrect data, and machines from reading data incorrectly.

For example of silly input, give any adults of over a certain age a paper form to fill in with these details:

Surname  
Forename  
Age  

They will usually enter their correct name but a certain number will enter 'over 21' in the age field. It's almost inevitable.

How do you stop them?

Easy when using a computer, add validation to the field. Validation restricts users to entering only a choice of limited options, for example, the  numbers 1-130.

Most input errors are caused by faulty typing or transmission and validation should be used where appropriate to trap these.  Validation is built into general purpose packages like database and spreadsheet, plus it can be coded into any programs.


In Microsoft Access database, the software will display an error message like this if someone enters an unacceptable piece of data:

wpe711.jpg (35442 bytes)

 In this case, cats may have one of three genders, M, F or N for neutered. Most users behave quite sensibly but may make accidental typing errors.   Validation is designed to detect these and prompt the user to re-enter the data by displaying a suitable error message.