On this page
What this issue is
A visitor fills in a lead form, makes one mistake (a bad phone number, say) and presses submit. The form shows an error, but the name, email, message and every other field are now empty. The one valid correction has turned into a full retype.
It usually has one of three causes. The page reloads after a server-side check and the HTML does not put the submitted values back. A script calls form.reset() or re-renders the form in its failure handler. Or a single-page app replaces the form component and loses its state.
Why it costs you leads or sales
People who reach a form are already interested. A wiped form feels like punishment for a small slip, and long fields such as a message box are the most painful to retype. Mobile visitors are hit hardest because typing is slow. Some will retry, many will not, and you never see the lost lead because nothing was submitted.
Example: illustrative numbers only. Of 100 visitors who hit one validation error, more finish when their data is kept.
- Fill in formVisitor enters all details
- Submit with one bad fieldValidation fails
- Form reloads emptyAll values wiped
- Retype everythingMany leave here
- Lead receivedNever sent
The break happens right after the error, before the visitor can correct it.
How to check if your site has it
You need to trigger an error on purpose and look at what is left. Do it on desktop and on a phone, because some themes behave differently on mobile.
Fill every field
Use obviously fake data, and type a long message so you can see if it disappears.
Break one field
Enter an invalid email such as name@ or a too-short phone number, then submit.
Compare the fields
Check that every other field still holds what you typed, including dropdowns, radio buttons, checkboxes and the message box.
Test the server-side path
Some errors only come from the server, such as a rejected email domain. Trigger one if you can, and check again.
Check the Network tab
In browser developer tools, open Network and submit. A full document request followed by an empty form means a page reload is the cause.
How to fix it
There are two sound approaches. Validate in the browser and submit with JavaScript so the page never reloads, or let the server re-render the form with the submitted values filled back in. Pick the one your platform supports.
Turn on AJAX submission
In plugins such as Contact Form 7, WPForms, Gravity Forms or Fluent Forms, use the default AJAX submit so errors show without a reload. In Gravity Forms, check the form embed has AJAX enabled.
Find conflicts
Disable caching, optimisation or custom scripts one at a time. A plugin that reloads or rebuilds the form is a common cause.
Update the plugin and theme
If a custom theme template renders the form, make sure it echoes submitted values back into each field.
Check the contact form template
The theme's contact form uses
form.errors. Make sure inputs print their values, for examplevalue="{{ form.email }}".Handle textareas
Put
{{ form.body }}between the textarea tags so the message survives.Test third-party form apps
If an app renders the form, check its settings or contact its support.
Look for tags that reset forms
Check Custom HTML tags that call
reset()or reload the page on form events, and pause them in Preview mode to test.Avoid redirect-on-click tags
A tag that navigates on a submit click can interrupt the form's own validation.
Use native Webflow forms
Webflow shows its error state without clearing fields. If fields clear, check custom code in Page Settings that handles submit.
Remove reset scripts
Search Custom Code for
reset()orlocation.reload()tied to the form.
Use the native form or survey element
Check whether the clearing happens in the native form as well as in an embedded copy.
Review custom code
Remove custom JavaScript in the funnel page that resets or reloads the form on error.
Contact support if native
If the native form itself clears on error, report it with a screen recording.
Check Velo code
If you use Velo, look for
$w('#form').reset()in an error handler and remove it.Use the built-in form
Wix Forms keep data on error. Replace heavily customised forms if needed.
Use a Form block
Native Form blocks show errors inline. If fields clear, check Code Injection for scripts touching the form.
Test without custom code
Remove injected code temporarily to confirm the cause.
Stop calling reset on failure
Only reset the form after a confirmed success response.
Prevent the default submit
Send the form with fetch and show errors in place, as in the snippet below.
Or repopulate on the server
If you re-render the page, output each submitted value into its input's
valueattribute, escaped, and into textarea content.
const form = document.querySelector('#lead-form');
form.addEventListener('submit', async (e) => {
e.preventDefault();
const res = await fetch(form.action, { method: 'POST', body: new FormData(form) });
if (res.ok) {
form.reset(); // only after success
// show thank-you message
} else {
const data = await res.json().catch(() => ({}));
// show data.errors next to fields; do NOT reset
}
});<input type="email" name="email" value="<?php echo isset($_POST['email']) ? esc_attr($_POST['email']) : ''; ?>">
<textarea name="message"><?php echo isset($_POST['message']) ? esc_textarea($_POST['message']) : ''; ?></textarea>Before
- Page reloads with an empty form
- Message box is blank
- Visitor must start again
After
- Error shown beside the bad field
- All other values still present
- Visitor fixes one field and submits
How to confirm it's fixed
- Fill every field, break one, submit: all other fields keep their values
- Long message text is still there
- Dropdowns, radios and checkboxes keep their selections
- Correcting the one field and resubmitting sends the lead
- The test lead reaches your inbox or CRM
- Same result on desktop and a real phone
- Same result in at least two browsers
How to prevent it happening again
This returns after form plugin updates, theme changes and new scripts. Add the error test to your release checklist, and keep a short note of which scripts touch the form.
- Test one validation error after every form, plugin or theme update
- Keep reset calls only in success handlers
- Review custom code that listens to submit events
- Test on mobile as well as desktop
- Record a short screen video of the error state when a form is built
How FunnelGuard handles this
FunnelGuard does not check this yet. Checking that field values survive a validation error is a possible future check, but today it is not part of what the robot does.
What FunnelGuard does cover nearby is the happy path. A robot visitor runs your real lead form on a schedule, checks each step, confirms the tracking hits fire and checks that the test lead reaches the inbox and CRM. A failure is re-checked from a second region before one alert goes out. That tells you if the form stops working, but not if it wipes data after a user error.
To watch for this issue, use the manual test above after every change. A session-recording tool can also show visitors who submitted, saw an error and left. Free plan: 1 site, 2 journeys, daily checks, no card.
Questions people ask
Why does my form clear all fields after an error?
Usually the page reloads after a server-side check and the form is not refilled with the submitted values. Another common cause is a script that calls form.reset() when submission fails. Check for both.
How do I stop a form from clearing when validation fails?
Submit with JavaScript (fetch) and show errors in place, resetting the form only after a successful response. If you use a page reload, print each submitted value back into its input and textarea, escaped.
Why does my WordPress contact form lose my message after an error?
Often a caching, optimisation or custom script interferes with the form plugin's AJAX submit, forcing a reload. Test with other plugins disabled and make sure AJAX submission is on.
Should a form keep passwords after an error?
Many sites clear password fields for security, which is acceptable if the error message says so. All other fields, especially long text, should be kept.
Why do file upload fields always empty after an error?
Browsers do not let a page refill a file input for security reasons. Tell the visitor clearly that they must choose the file again, or upload it before final submission.
How can I test if my form keeps data after an error?
Fill in every field, enter one invalid value such as a bad email, and submit. Then check that all other fields still hold what you typed. Repeat on mobile.
Does FunnelGuard detect forms that clear after an error?
No. FunnelGuard does not check this yet. It runs your real form journey, checks tracking hits and confirms test leads reach your inbox and CRM, so test error handling by hand.
Related issues
- CNV-032Validation error message not shown, form just does nothingFix guide
- CNV-033Error message shown in the wrong place or hidden off-screenFix guide
- CNV-037Client and server validation disagree (passes client, server rejects)Fix guide
- CNV-031Required field can be left blank and the form still submitsFix guide
- CNV-038Validation fires on every keystroke and blocks typingFix guide
- CNV-042Error text is a raw code ('error 422')Fix guide