Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Form error message in the wrong place or off-screen: how to fix it

CNV-033Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A visitor fills in a form and presses submit. Validation fails, and an error message is created. But it is shown in a spot they cannot see. Common cases: a summary banner at the top of a long page while the button is at the bottom; an error hidden behind a sticky header; a message inside an accordion or tab that is closed; or red text that is the same colour as the background.

Why it costs you leads or sales

People who press submit and see no change usually try once or twice more, then leave. They do not scroll up to look for a message. The visitor was ready to give you their details, so each one lost is a warm lead. Mobile makes it worse: the screen is small, the keyboard covers half of it, and a banner at the top is far out of view.

Where the lead is lost
  1. Fills in formLeaves a field invalid
  2. Presses submitValidation fails
  3. Error shownOff-screen or behind header
  4. Visitor retriesSees no change
  5. Lead submittedNever happens

The error exists, but the visitor never sees it.

Error appears out of view

The message renders at the top while the visitor stays at the button.

How to check if your site has it

Test your form by hand
  1. Submit the form empty

    Press the submit button with every field blank. Note where you are looking and whether you can see any message without scrolling.

  2. Submit with one bad value

    Fill everything correctly except a field near the top, such as email. Scroll to the button and press it. Does the page move to the problem?

  3. Test on a real phone

    Repeat on a phone, with the keyboard open. Browser resize tools miss keyboard overlap.

  4. Check sticky elements

    Scroll so the error field is near the top of the screen. Is it covered by a fixed header, cookie banner or chat widget?

  5. Check hidden containers

    If the form has tabs, steps or accordions, trigger an error in a hidden section and see whether the section opens.

  6. Inspect the DOM

    Right-click the error text, choose Inspect, and look for display:none, visibility:hidden, height:0, or a colour matching the background.

How to fix it

The pattern that works everywhere: put the message directly under its field, mark the field as invalid, scroll the first invalid field into view below any sticky header, and move focus to it. If you also keep a summary at the top, make it a short list of links to the fields.

Scroll to and focus the first invalid fieldjavascript
document.querySelector('form').addEventListener('submit', function (e) {
  var first = this.querySelector(':invalid, [aria-invalid="true"]');
  if (first) {
    e.preventDefault();
    first.scrollIntoView({ behavior: 'smooth', block: 'center' });
    first.focus({ preventScroll: true });
  }
});
Keep errors clear of a sticky headercss
input, select, textarea { scroll-margin-top: 120px; }
.field-error { color: #b00020; font-size: 14px; margin-top: 4px; display: block; }
input[aria-invalid="true"] { border: 2px solid #b00020; }
Error placed next to its fieldhtml
<label for="email">Email</label>
<input id="email" name="email" type="email" aria-invalid="true" aria-describedby="email-error">
<span id="email-error" class="field-error" role="alert">Enter an email like name@example.com</span>
Where to change it by platform
  1. Pick inline errors in your form plugin

    Most form plugins offer a setting for where errors show. Look in the form's settings or the plugin's global settings for validation or error options, and choose messages under each field. Exact names depend on the plugin.

  2. Add the CSS above

    Go to Appearance > Customize > Additional CSS and add the scroll-margin-top rule so the sticky header does not cover the field.

Error placement

Before

  • One banner at the top of a long page
  • Message hidden behind sticky header
  • Focus stays on the button
  • Visitor sees nothing happen

After

  • Message directly under each field
  • Page scrolls to first error
  • Focus moves to the field
  • Visitor knows what to correct

How to confirm it's fixed

Confirmation checks
  • Submitting empty shows a message beside each required field
  • The first invalid field is fully visible after submit, not under a header
  • Keyboard focus lands on that field
  • Works on a real phone with the keyboard open
  • Errors inside tabs or accordions open the section
  • A valid submission still goes through and reaches your inbox

How to prevent it happening again

Placement breaks when someone adds a sticky bar, a cookie banner or a chat widget, or when a theme or form plugin update changes the layout. Re-run the manual test after any change to the header, the form or the plugin version, and always on a phone.

How FunnelGuard handles this

FunnelGuard detects this only partly. A robot visitor runs your form journey on a schedule and can assert that the expected error text appears after a bad submission. If the text is missing from the page, you get an alert with a screenshot.

It does not check position. It cannot tell you whether the message sits next to the field, is covered by a sticky header, or is out of view for a person on a small phone screen. Cover that by hand: run the checklist above on a real phone after each design or plugin change, and look at the FunnelGuard screenshot when an alert fires. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans include a 3-day free trial.

Questions people ask

Why is my form error message not showing?

It may be rendered but out of sight: at the top of a long page, behind a sticky header, inside a closed accordion, or styled in the background colour. Inspect the error element in your browser and check its position, display and colour. If it is not in the page at all, see the separate issue of errors that are never shown.

How do I make a form scroll to the error?

On a failed submit, find the first invalid field, call scrollIntoView on it and then focus it. Add scroll-margin-top in CSS so a fixed header does not cover it. Most form plugins offer a similar built-in option.

Where should form error messages be placed?

Directly below or beside the field they relate to, in text that says how to fix it. A short summary at the top can help on long forms, but it should link to the fields rather than replace inline messages.

Why does my form error appear behind the sticky header?

The browser scrolls the field to the very top of the screen, where a fixed header covers it. Set scroll-margin-top on inputs to at least the header's height so the field stops below it.

Why does my form look like it does nothing on mobile?

On a phone the error may be far above the button, or hidden by the on-screen keyboard. Visitors do not scroll up to look. Show errors beside the field and scroll to the first one.

Can FunnelGuard detect a form error in the wrong place?

Only partly. FunnelGuard can check that the expected error text appears after a bad submission, but it does not check where it appears or whether a person can see it. Test position by hand on a real phone.

Does a hidden form error affect accessibility?

Yes. If focus stays on the button and the message is not linked to the field, screen reader users may never hear it. Use aria-invalid, aria-describedby and role=alert, and move focus to the first invalid field.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: assert text; no position check.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.