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.
- Fills in formLeaves a field invalid
- Presses submitValidation fails
- Error shownOff-screen or behind header
- Visitor retriesSees no change
- Lead submittedNever happens
The error exists, but the visitor never sees it.
The message renders at the top while the visitor stays at the button.
How to check if your site has it
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.
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?
Test on a real phone
Repeat on a phone, with the keyboard open. Browser resize tools miss keyboard overlap.
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?
Check hidden containers
If the form has tabs, steps or accordions, trigger an error in a hidden section and see whether the section opens.
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.
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 });
}
});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; }<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>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.
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.
Check the theme form code
In Online Store > Themes > Edit code, open the form section or snippet, such as the contact form. Make sure errors from form.errors render next to the fields.
Add scroll-margin-top
Add the CSS rule to your theme's main stylesheet, using your header's real height.
Position the error state
Webflow's form block has an Error Message element. Select the form, open the Error state, and make sure the message is visible and placed close to the submit button, since Webflow shows one message per form.
Add per-field messages if needed
Use custom code for field-level errors, using the snippets above.
Review form settings
Open the form in the form builder and set fields as required. Preview the published page on mobile and check where the message appears.
Add custom CSS
Use the form's custom CSS option, or the page's custom code, to add the scroll margin and error styling.
Check the form's error text
In the editor, select the form and open its settings to review error messages and make sure fields are marked required. Preview in mobile view.
Keep forms clear of fixed headers
If the form sits near a header that stays at the top, move it down or turn off the sticky behaviour.
Test the form block
Squarespace form blocks show their own messages. Submit empty on mobile and check visibility.
Add CSS
Use Design > Custom CSS to add the scroll margin rule if a fixed header hides the field.
Render errors next to fields
Output the error element after each input and connect it with aria-describedby.
Add the script
Scroll to and focus the first invalid field on failed submit, as shown above.
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
- 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.
Related issues
- CNV-032Validation error message not shown, form just does nothingFix guide
- CNV-031Required field can be left blank and the form still submitsFix guide
- CNV-034Errors clear all entered dataFix guide
- CNV-037Client and server validation disagree (passes client, server rejects)Fix guide
- CNV-038Validation fires on every keystroke and blocks typingFix guide
- CNV-042Error text is a raw code ('error 422')Fix guide