Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

SC 2.6: Validation checks on entered data

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

60 minutes

The asset list full of rubbish

A support team keeps a list of every PC in the school. Over a year, people type the tags by hand. Soon there are blank tags, tags with letters where numbers belong, and a room number of 9000.

Checks at the moment of typing would have stopped all of it.

By the end of this lesson

Note

I can choose the right check for a field and write it.

Key words

WordWhat it means
Validationa check that data is sensible when it is entered
Verificationa check that data was copied correctly
Presence checkis something entered at all?
Length checkis the number of characters allowed?
Range checkis the number between a low and a high limit?
Type checkis it the right kind of data, such as a number?
Format checkdoes it follow the right pattern?

The cells students fill in are left blank in this preview.

Starter

Have a go

Starter

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Five checks, each with a job

Validation checks that data is sensible. It cannot prove the data is true, only that it is possible.

Use the right check for each field. Many fields need more than one.

The five checks

CheckAsksUse it forExample that fails
PresenceIs it there?A field that must be filledEmpty tag
LengthRight number of characters?Passwords, postcodes, phone numbersPassword of 3 letters
RangeBetween the limits?Ages, room numbers, quantitiesRoom 9000
TypeRight kind of data?A number fieldLetters in a room number
FormatRight pattern?Dates, emails, asset tagsTag `AB123` with no hyphen

The cells students fill in are left blank in this preview.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

6 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.