On this page
What this issue is
A visitor fills in a form, presses the button, and one field fails a check. Maybe the phone number has a space in it, or a required box was skipped. The page shows an error, and the fields they filled correctly are now empty.
This usually has one of three causes. The form does a full page reload and the server sends back a blank form. A script calls form.reset() after any response, including an error. Or a framework re-renders the form and drops its values. It differs from an error that appears only after submit (PRF-215), because here the real damage is the lost data.
Why it costs you leads or sales
Typing is the hard part of a form, especially on a phone. Asking someone to do it twice for a mistake in one field feels like a punishment. Many will not try again, and you never see them, because the lead was lost before it reached your inbox or CRM.
It also hurts the longest forms most: checkout addresses, quote requests and booking forms, where the visitor has put in the most effort.
Example: illustrative numbers only. Of 100 visitors who hit an error, more finish when their data is kept.
- Fills formVisitor types every field
- SubmitsOne field fails a check
- Error shownAll fields come back empty
- RetypesMost visitors give up here
- Lead receivedNever arrives
The break happens when the error page comes back with empty fields.
How to check if your site has it
Fill every field
Use realistic test data, including a message or free-text box.
Trigger one error on purpose
Enter an invalid email such as name@ or leave a required field empty. Try a bad phone number too if there is one.
Submit and look at the other fields
Check that every other field still holds what you typed, including dropdowns, checkboxes, radio buttons and text areas.
Repeat on a phone
Use a real phone or browser device mode. Mobile browsers and autofill can behave differently.
Test with scripts blocked or slow
Reload with a throttled connection in the browser developer tools. A form that falls back to a full page reload often loses data.
How to fix it
The goal is simple: an error must never clear a field that was valid. The best way is to validate in the browser and never reload the page. The fallback is to put the submitted values back when the server sends the form again.
Find which form plugin you use
Contact Form 7, WPForms, Gravity Forms, Fluent Forms and Elementor forms all keep values by default when AJAX submission is on.
Turn on AJAX submission
In the form's settings, enable AJAX (in Gravity Forms it is on the form embed or shortcode, ajax="true"). A page reload is the most common cause.
Look for caching or optimisation clashes
Deactivate caching, minify and JavaScript delay plugins one at a time and retest. They can break the form script so it falls back to a reload.
Check custom code
Search your theme or child theme for form.reset() or custom success handlers that run on errors too.
Contact and customer forms
In the theme editor, open Edit code and find the form section. Liquid forms use {% form 'contact' %}. Repopulate fields with {{ form.email }} style values.
Add values back to inputs
Set value="{{ form.body }}" on inputs and put {{ form.body }} inside textareas, so a failed submit keeps them. Many current themes already do this; older or custom ones may not.
Checkout
Standard Shopify checkout keeps entered details. If yours does not, a third-party app or customisation is likely the cause, so disable it and retest.
Check for tags that touch the form
Custom HTML tags that rewrite the form, reset it or trigger a reload on submit can cause this. Open Preview mode and submit with an error.
Pause suspect tags
Disable form-related custom tags in a workspace, preview, and retest. GTM itself does not clear fields, but scripts it injects can.
Use native Webflow forms
Native forms submit without a reload and keep values. Webflow shows its own error message, so fields normally stay filled.
Check custom code
Look in Project Settings > Custom Code and page embeds for scripts that reset the form or replace it after an error.
Check third-party embeds
If you embed a form from another tool, test it on its own and review its settings.
Open the form or survey builder
Test the form in preview with a deliberate error and see whether fields persist.
Remove custom scripts
Check Custom JS or Custom Code elements on the page for reset logic.
Prefer the native form on the page
If the form is embedded via iframe or code, re-embed the current version from the builder.
Use Wix Forms
Native Wix forms show errors inline and keep values. Check that the form is not a custom-built replacement.
Review Velo code
If you use Velo, search for $w('#form').reset() or similar calls in the submit handler and make sure they run only on success.
Use a native form block
Native form blocks validate inline and keep values. Test with a deliberate error.
Check code injection
Under Settings > Advanced > Code Injection, look for scripts that reset forms.
Validate in the browser first
Use HTML attributes such as required, type="email" and pattern, and intercept submit with JavaScript so the page never reloads.
Only reset on success
Call form.reset() only after a confirmed success response.
Refill values server-side
If the server must re-render the form, escape and echo the submitted values back into each input. Never echo passwords.
const form = document.querySelector('#lead-form');
form.addEventListener('submit', async (e) => {
e.preventDefault();
if (!form.checkValidity()) {
form.reportValidity();
return; // fields stay filled
}
const res = await fetch(form.action, { method: 'POST', body: new FormData(form) });
if (res.ok) {
form.reset();
// show thank-you message
} else {
// show error message, leave fields as they are
}
});<input type="email" name="email"
value="<?php echo isset($_POST['email']) ? htmlspecialchars($_POST['email'], ENT_QUOTES, 'UTF-8') : ''; ?>">
<textarea name="message"><?php echo isset($_POST['message']) ? htmlspecialchars($_POST['message'], ENT_QUOTES, 'UTF-8') : ''; ?></textarea>Before
- Page reloads after submit
- Error appears, every field is empty
- Visitor retypes or leaves
After
- Error appears next to the bad field
- Everything else stays filled
- Visitor fixes one field and sends
How to confirm it's fixed
- Fill every field, trigger an error, and see all valid fields stay filled
- Check dropdowns, checkboxes and radio buttons keep their choice
- Test on a phone and in at least two browsers
- Test with browser autofill
- Submit a valid form afterwards and confirm the lead reaches your inbox or CRM
- Confirm the form still clears after a successful send
How to prevent it happening again
Forms break after theme updates, plugin updates and script changes. Add a deliberate-error test to your release checklist for any change that touches a form, a checkout or a page builder template. Ask your developer or agency to keep validation in the browser by default, and to treat any full page reload on submit as a bug.
If you use session recordings or a tool like Microsoft Clarity or Hotjar, watch for sessions where a visitor submits, sees an error, then leaves. That pattern points to this issue.
How FunnelGuard handles this
FunnelGuard does not check for this yet. Checking that a form keeps entered data after a validation error is a possible future check, but it is not part of the product today.
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, confirms the tracking hits are sent, and checks that the test lead reaches your inbox and CRM. If a form change stops submissions from working at all, that journey can fail and you get one alert with a screenshot and a likely cause, after a re-check from a second region. A form that works but wipes data after a mistake is a different problem and would not be reported.
To watch for it yourself, run the deliberate-error test above after every form or theme change, and review session recordings for visitors who hit an error and leave. The Free plan covers 1 site and 2 journeys with daily checks and no card, and every paid plan has a 3-day free trial.
Questions people ask
Why does my form clear all fields when there is an error?
Usually the form submits with a full page reload and the server returns a blank form, or a script calls form.reset() after any response. Turn on AJAX or browser-side validation, and make sure the form only resets after a successful send.
How do I keep form data after a validation error?
Validate in the browser with attributes like required and type="email", and stop the page from reloading. If the server must re-render the form, echo the escaped submitted values back into each field.
Is it normal for a password field to clear after an error?
Yes, password fields are usually cleared on purpose for security, and file inputs cannot be refilled either. Tell the visitor clearly that they need to enter these again, and keep every other field filled.
Why is my WordPress contact form losing data when I submit?
The form plugin is probably doing a full page reload, often because AJAX submission is off or a caching or JavaScript optimisation plugin broke the form script. Enable AJAX in the form settings, then disable optimisation plugins one at a time to find the clash.
Does losing form data really affect conversions?
Yes. Retyping a whole form is frustrating, especially on a phone, so many visitors leave instead. The lost leads are invisible because the form never reaches your inbox or CRM.
How do I test whether my form keeps data on error?
Fill every field, enter one invalid value such as an email without a domain, and submit. Check that all other fields, including dropdowns and checkboxes, still hold their values. Repeat on a phone.
Does FunnelGuard detect forms that lose data on errors?
No. FunnelGuard does not check this yet; it is a possible future check. It does run your real form journey on a schedule and checks that test leads reach your inbox and CRM, which catches forms that stop submitting.
Related issues
- PRF-215Errors only shown after submit, all fields clearedFix guide
- PRF-214Error messages unclear or genericFix guide
- PRF-217Form error shown at top, off-screen on mobileFix guide
- PRF-230Back button loses form/cart stateFix guide
- PRF-213Email validation rejects valid addresses (plus addressing, new TLDs)Fix guide
- PRF-212Required fields not markedFix guide