Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Form fields shifting when validation errors appear: how to fix

PRF-033Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

Layout shift is when visible content moves without the visitor asking for it. On forms, a common cause is validation: a visitor leaves a field blank or types a bad email, and a red message appears. If that message is added to the page flow, every field below it jumps down by the height of the message.

The shift is worst when the message appears above the field, or at the top of the form as a summary. The field the person is about to tap moves out from under their finger. Messages that wrap onto two lines on a narrow phone make the jump bigger.

How a validation message breaks the next tap
  1. Visitor fills the formMoves from field to field
  2. Field loses focusValidation runs on blur
  3. Error inserted aboveNext field moves down
  4. Tap lands on wrong spotMis-tap or lost place
  5. Form abandonedNo lead captured

The error is inserted in the page flow, so everything below it moves.

Why it costs you leads or sales

Forms are where visitors turn into leads or buyers. Anything that makes the form feel unstable adds friction at the last step. People tap the wrong field, hit a link or button that moved into place, or simply lose track of what to fix.

It also counts as layout shift in Google's Cumulative Layout Shift (CLS) metric when the shift is not within 500 ms of a user input. Validation that runs on blur or after a server response can fall outside that window, so it may add to your CLS score. Impact is usually medium: it rarely blocks a form outright, but it hurts mobile completion most.

Mobile form completion by error styleExample numbers
Mobile form completion by error style (example)Errors push fields down: 52 %; Space reserved for errors: 61 %023475261Errors push fields do…Space reserved for er…%

Example: illustrative numbers only, not measured data. Stable error placement keeps more visitors moving through the form.

How to check if your site has it

Test your form by hand
  1. Trigger every error

    Open the form on a phone-sized screen. Leave required fields empty, type an invalid email and phone number, then tap submit.

  2. Watch the fields below

    Note whether any field, label or the submit button moves when a message appears. Try both blur validation and submit validation.

  3. Record the shifts in Chrome DevTools

    Open DevTools, go to the Performance panel, record while you trigger errors, then look for red Layout Shift entries in the Experience row. Select one to see which element moved.

  4. Highlight shifts live

    In DevTools open the Rendering tab and tick Layout Shift Regions. Shifted areas flash blue as you trigger errors.

  5. Try long messages and narrow screens

    Test a 320 px wide viewport and any translated versions of the page. Longer text wraps and makes the shift larger.

How to fix it

There are two reliable approaches. Reserve space: give every field a message area with a fixed minimum height, so showing text fills space that was already there. Place it out of flow: show the message below the field in a reserved slot, or in a tooltip or overlay that does not push content. Avoid inserting messages above the field.

Error message placement

Before

  • Error injected above the field in normal flow
  • Fields and button jump down on every error
  • Summary banner at the top of the form pushes everything

After

  • Each field has a message slot with reserved height
  • Error text fills the slot, nothing moves
  • Summary uses a reserved area or sits next to the button
Reserve space for the error messagecss
.field { margin-bottom: 0; }
.field-error {
  min-height: 1.5em;   /* room for one line, always present */
  font-size: 0.875rem;
  line-height: 1.5;
  color: #b00020;
}
/* Empty message keeps its height, visible text fills it */
.field-error:empty { visibility: hidden; }
Message slot that is always in the pagehtml
<label for="email">Email</label>
<input id="email" type="email" aria-describedby="email-error">
<div id="email-error" class="field-error" aria-live="polite"></div>
Fix by platform
  1. Find your form plugin's error styles

    Plugins such as Contact Form 7, WPForms, Gravity Forms and Elementor Forms each use their own error classes. Inspect an error in the browser to find the class name.

  2. Add CSS under Appearance > Customize > Additional CSS

    Give the field wrapper or error class a min-height, or position the message so it does not add to the flow. Test with the plugin's own validation settings.

  3. Prefer messages below fields

    If your plugin offers an error position or summary option, choose the one that does not insert content above the fields.

How to confirm it's fixed

Confirmation checks
  • Triggering every error moves no field, label or button
  • Layout Shift Regions shows no flashes when errors appear
  • The Performance panel records no layout shift entries during validation
  • Long messages on a 320 px screen still do not move the form
  • Screen reader still announces each error
  • The form still submits with valid data

How to prevent it happening again

Add error-state testing to your release checklist for any form change, theme update or new plugin. Agree one error pattern in your design system and reuse it. Keep copy short, and recheck after translating the page, because longer text wraps.

You can also monitor real-user CLS in the Core Web Vitals report in Google Search Console, or with the Chrome User Experience Report, and run Lighthouse or PageSpeed Insights after form changes. Lab tools often miss validation shifts because they do not trigger errors, so manual tests remain necessary.

How FunnelGuard handles this

FunnelGuard does not check for this yet. Detecting layout movement while validation messages appear is a possible future check, not a current feature.

What FunnelGuard does do nearby: a robot visitor runs your real lead form journey on a schedule from the EU or the US, checks each step, and confirms the test lead reaches the inbox and CRM. If a form stops working, a failure is re-checked from a second region and you get one alert with a screenshot and a likely cause. That tells you whether the form submits, not whether the layout moves.

To watch for layout shift on forms, use the manual checks above, Lighthouse or PageSpeed Insights, and the Core Web Vitals report in Search Console. A free read-only website audit and a free plan (1 site, 2 journeys, daily checks, no card) are available if you want to monitor form submissions alongside.

Questions people ask

Why do my form fields jump when an error message appears?

The error message is being added to the page flow, usually above or between fields, so everything below it is pushed down. Reserve a fixed-height slot for each message so the text fills space that already exists.

How do I stop form validation messages from causing layout shift?

Keep an empty message element under each field with a min-height of about one line, and fill it with text when validation fails. You can also show errors in an overlay or tooltip that does not take up space in the layout.

Does form validation affect Cumulative Layout Shift (CLS)?

Yes, it can. Layout shifts that happen more than 500 ms after a user input are counted, so validation on blur or after a server response may add to your CLS score. Shifts right after a tap or key press are usually excluded.

Should error messages go above or below form fields?

Below the field is the safer choice, in a space that is reserved in advance. Messages above a field move the field the person is about to use, which causes mis-taps, especially on phones.

How can I see which element shifted when an error appears?

In Chrome DevTools, open the Rendering tab and tick Layout Shift Regions, then trigger the error. You can also record in the Performance panel and select the Layout Shift entry to see the moved elements.

Will reserving space for errors hurt accessibility?

No, as long as the message stays in the page text. Link it to the input with aria-describedby and use aria-live="polite" so screen readers announce it.

Does FunnelGuard detect layout shift from form validation?

No, not yet. FunnelGuard checks that your form journey works and that test leads arrive, but layout shift on validation is only a possible future check. Use DevTools, Lighthouse and Search Console to watch for it.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

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.