Skip to main content
WCAGrules
Quick navigation

Warn users before a time limit runs out

SCR16 is a sufficient technique in a pair with SCR1, which handles the extension. On its own it warns and nothing more, so the two go together or neither counts. The number is W3C's and it is specific. Twenty seconds or more before the limit lands, the script puts up a confirm dialog saying time is nearly up and asking whether the user wants more. Answer yes and the timer resets. Answer no and it expires. Say nothing at all and it also expires, because W3C treats no answer as a no, which is the detail that decides whether an unanswered dialog counts as a defect. The technique is written for limits set with window.setTimeout. One thing our reviewers insist on that the technique does not spell out is that the warning has to reach assistive technology, not merely appear. A browser's own confirm dialog does that for free, which is presumably why nobody wrote it down.

How we find it in an audit

This is manual work, and it has a runnable shape. A reviewer starts a timer twenty seconds shorter than the limit, waits for it, and checks whether a warning is on screen by the time it fires. Then the rest. Is the warning announced or only drawn, does answering yes actually keep the session alive, and how much room does the user get before the answer stops mattering. We run it on carts, on timed quizzes and on any flow that logs people out, because those are where an unexpected expiry costs the most.

How affected users experience it

A countdown drawn in the corner of the page is invisible to a blind user and easy to miss for a sighted one who is concentrating on a form. Without an announcement the deadline arrives as pure surprise. The page changes underneath the person using it, their answers are gone, and the only clue is that the thing they were reading a second ago is no longer there. Nothing tells them a clock was ever running.

Passes vs. fails

Passes: warned, and one press extends. Fails: silent expiry destroys work.

Passes

if (confirm("Two minutes left on this quiz. Do you need more time?")) { resetLimit(); }
// Fired at least 20 seconds out. No answer is treated as a no.

Fails

<div class="countdown">02:00</div>
<!-- Drawn in the header, announced to nobody, and the quiz auto-submits at zero. -->

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

Other ways to satisfy this rule

11 guides on this site are filed under 2.2.1 Timing Adjustable. W3C lists this one as sufficient for that rule only alongside SCR1, so the pair is what passes and neither half does on its own.

This guide is our interpretation of W3C technique SCR16: Providing a script that warns the user a time limit is about to expire. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations