On this page
What this issue is
This is two form problems stacked together. First, the form gives no feedback until submit: a bad email, a missing phone number or a short password is only reported after the visitor clicks the button. Second, the page reloads or resets and clears every field, so the visitor sees an error message above an empty form.
It usually comes from a plain HTML form that posts to the server, where the server returns a fresh page without refilling the inputs. It also happens in forms where a script calls form.reset() after any response, including an error response.
Why it costs you leads or sales
Retyping a whole form is work, especially on a phone. A visitor who made one small mistake is punished by losing everything, and many will simply leave instead of trying again. The visitor is often your warmest one: they already decided to submit.
It is also hard to see in your numbers. The click on submit counts as an attempt, but no lead arrives. Your analytics may show a healthy number of form views and clicks with a weak number of completed leads, and nothing looks broken.
0:00
Visitor fills in 8 fields on a quote form.
1:30
Visitor presses submit. Phone number has a space the server rejects.
1:31
Page reloads. Error appears at the top and all 8 fields are empty.
1:40
Visitor closes the tab. No lead, no error in your logs.
The visitor submits once, sees an error and finds the form blank.
How to check if your site has it
Test the form yourself, on a phone and on a desktop. It takes five minutes.
- Fill every field, but enter a deliberately wrong email such as
name@. - Click out of the email field. Does an error appear straight away, next to the field?
- Press submit anyway. Does the page reload or scroll to the top?
- After the error, are the other fields still filled in?
- Leave a required field empty and submit. Is the focus moved to that field?
- Repeat on a phone, using the on-screen keyboard.
- Check the browser Network tab (DevTools, Network): a failed submit that returns a full HTML page usually means a server-side reload.
How to fix it
There are two fixes and you want both: show errors early, and never throw away what the visitor typed. Start with the one your platform makes easiest.
Check your form plugin settings
Most form plugins (Contact Form 7, WPForms, Gravity Forms, Fluent Forms) can submit by AJAX, which keeps the page and the entered values. Look for an AJAX submission or inline validation option in the form settings and turn it on.
Look for theme or cache conflicts
If the form still reloads, disable a page cache or a script optimiser for that page. Combined or delayed JavaScript can stop the plugin's validation script from loading.
Update the plugin
Older versions may lack inline validation. Update and retest.
Use the theme's form markup
Shopify's contact and customer forms return errors with
form.errors. In your theme's form section, refill each input with its value, for examplevalue="{{ form.email }}".Add the required attribute and type
Use
type="email"andrequiredso the browser validates before the form is sent.Test in the theme preview
Edit a duplicate theme, make the changes, and test before publishing.
Do not fix the form here
GTM cannot repair form behaviour safely. Use it to measure instead: a Form Submission trigger plus a custom event for validation errors lets you see how often errors happen.
Use native Webflow forms
Webflow forms submit without a page reload and show the success or error message in place, so the fields are kept. If you post to an external action URL, switch to the native form or use a script that submits by fetch.
Mark required fields
Select each input and turn on Required in the element settings. Choose the correct input type (Email, Phone) so the browser checks the format.
Use the form builder's required settings
In the form or survey builder, mark fields as Required and choose the right field type (email, phone). The embedded form shows field errors before sending.
Test the embed
If a custom page posts the form elsewhere, retest after each change to confirm values stay in place after an error.
Use Wix Forms
Set fields to Required in the form settings and pick the right field type. Wix forms validate in place and keep values.
Check custom code
If you added Velo code that calls reset on the form, make it reset only after a successful submit.
Use a Form block
Turn on Required for each field in the Form block. The block validates in place without clearing values.
Check code injection
If you inject custom form scripts, remove any code that clears inputs on error.
Add browser validation attributes
Use
type,required,patternandautocompleteon each input.Validate on blur
Show the error next to the field when the visitor leaves it, and clear it as soon as the value is valid.
Submit with fetch
Send the form without a page reload, and only reset the form after a success response.
If you must reload, refill
Return the submitted values from the server and put them back in each input.
<form id="lead" novalidate>
<label for="email">Email</label>
<input id="email" name="email" type="email" autocomplete="email" required aria-describedby="email-error">
<p id="email-error" role="alert"></p>
<button type="submit">Get my quote</button>
</form>
<script>
const form = document.getElementById('lead');
const email = document.getElementById('email');
const error = document.getElementById('email-error');
function check() {
error.textContent = email.validity.valid ? '' : 'Enter an email like name@example.com';
}
email.addEventListener('blur', check);
email.addEventListener('input', () => { if (error.textContent) check(); });
form.addEventListener('submit', async (e) => {
e.preventDefault();
check();
if (!form.checkValidity()) { form.querySelector(':invalid').focus(); return; }
const res = await fetch('/api/lead', { method: 'POST', body: new FormData(form) });
if (res.ok) { form.reset(); } // reset only on success
else { error.textContent = 'We could not send that. Please try again.'; }
});
</script>Before
- No feedback until submit
- Page reloads
- Error sits at the top
- All fields empty
After
- Error shown next to the field when it is left
- No reload
- Focus moves to the first problem
- Everything else stays filled in
How to confirm it's fixed
Enter one bad value
Fill all fields and make only the email invalid.
Leave the field
An error should show next to the email field before you submit.
Submit anyway
The page should not reload and the other fields must keep their values.
Fix the value and submit
Confirm the lead arrives in your inbox or CRM and the thank-you state appears.
Repeat on mobile
Use a real phone or device mode in your browser and check that the error is visible without scrolling.
How to prevent it happening again
- Add a form test with a deliberate error to your release checklist.
- Retest after changing form plugins, themes, caching or script optimisation.
- Never call reset on a form unless the submit succeeded.
- Track form errors as an analytics event so you can see how often they happen.
- Keep field types accurate (email, tel) so browsers help the visitor.
How FunnelGuard handles this
FunnelGuard does not check for this yet. Spotting inline validation and kept field values is a possible future check.
What FunnelGuard does today is run your real lead form journey on a schedule from the EU or the US, check each step, check the tracking hits sent to platforms like GA4, Google Ads and Meta, and check that a test lead reaches your inbox and CRM. If the form breaks outright, so no test lead arrives, you get one alert with a screenshot and a likely cause after a second-region recheck. That will not tell you whether your error messages are friendly or whether fields are kept after a mistake.
To watch for this issue, repeat the manual test above after each site change, and use a session replay or form analytics tool to see where visitors abandon fields. A free FunnelGuard plan covers 1 site and 2 journeys with daily checks, and there is a free read-only website audit.
Questions people ask
Why does my form clear all fields after an error?
The form probably posts to the server, which returns a new page without refilling the inputs. A script that calls reset on any response can do the same. Fix it by submitting with fetch and resetting only on success, or by returning the submitted values and putting them back in each input.
How do I stop a form from clearing when there is a validation error?
Validate in the browser first using required, type and pattern attributes, and submit with JavaScript so the page does not reload. If the server must reject the form, return the entered values and refill each field. Reset the form only after a successful response.
Should form errors show as the user types or after submit?
Show them when the visitor leaves a field, and again on submit as a safety net. Errors on every keystroke feel pushy, and errors only after submit force people to hunt for problems. Clear each message as soon as the value is valid.
Why is my form losing leads even though submit clicks look fine?
A click on submit counts as an attempt even if the form rejected it. If errors appear late and the form empties, visitors leave without a lead being created. Compare submit clicks with leads that reach your CRM, and test the form with a deliberate mistake.
How do I test form validation on my website?
Fill the form with one bad value, such as an email without a domain, and watch what happens when you leave the field and when you submit. Check that the error sits next to the field, focus moves to it, and the other fields keep their values. Repeat on a phone.
Does FunnelGuard detect forms that clear after an error?
No. FunnelGuard does not check this yet. It does run your real form journey on a schedule and checks that a test lead reaches your inbox and CRM, so it can show when the form stops working altogether.
Is browser built-in validation enough?
It is a good start for required fields and email format, and it keeps values by default. It can look inconsistent across browsers and its messages are generic, so many sites add custom inline messages. Keep the native attributes either way, because they also help assistive technology.
Related issues
- PRF-216Form loses entered data on validation errorFix guide
- PRF-214Error messages unclear or genericFix guide
- PRF-212Required fields not markedFix guide
- PRF-217Form error shown at top, off-screen on mobileFix guide
- PRF-213Email validation rejects valid addresses (plus addressing, new TLDs)Fix guide
- PRF-219Submit button disabled with no explanationFix guide