Back to all articlesLead capture

Recover form errors without erasing the visitor's answers

Alactic Editorial10 min read

Prepared with AI assistance by Alactic Editorial. Examples identified as hypothetical are illustrative, not customer results.

A visitor writes a detailed enquiry, adds an attachment and presses Submit. Validation fails. The page reloads with a generic error and an empty message box. The visitor now has two jobs: diagnose the problem and reconstruct the enquiry.

Good recovery removes the second job. Preserve entered values where appropriate and safe, identify what needs attention and offer an available next action. Every error state should answer three questions: what happened, what is still here and what can I do next?

Start with a recovery specification, not just friendlier wording. The filled table below gives a business owner, designer and developer a shared artifact to review before changing a form. It describes recommended behaviour, not an existing product capability.

1. Separate correction from submission failure

A single banner saying something went wrong cannot cover every failure. The next action depends on whether an answer needs correction, the service cannot accept the enquiry or the previous attempt may already have succeeded.

  • Field error: An answer needs attention. Keep the attempted value visible so the visitor can edit it.
  • Attachment error: A file was rejected or did not finish uploading. Explain whether to replace, retry or remove it.
  • Confirmed rejection: The service confirms that the enquiry was not accepted. Explain recovery without blaming valid fields.
  • Unknown outcome: No reliable confirmation arrived. Do not call this a definite rejection or encourage resubmission without explaining the duplicate risk.
  • Expired session: A renewal step is required. Explain what will survive that step before the visitor takes it.

These distinctions also prevent misleading success states. A selected file is not necessarily uploaded. An enquiry waiting on the page is not submitted. Acceptance by the form does not establish that a member of staff has read it.

2. Agree what stays, what clears and why

Preservation includes invalid entries, not just fields that passed validation. An email address with a typo is easier to correct when the visitor can still see it. Do not reset unrelated answers because one field failed.

For an ordinary enquiry, begin by preserving the name, email address, subject, message, selected options and checkbox states during current-page correction. Then distinguish three promises:

  • Current-page preservation: Answers remain while the visitor corrects or retries without leaving.
  • Recovery-step preservation: Answers survive an action such as renewing an expired session.
  • Return-visit restoration: Answers reappear after closing or revisiting the page.

Do not imply the third promise when only the first exists. Persistent drafts raise shared-device and sensitive-information concerns and need a deliberate decision. Never restore one person's enquiry into another person's session.

Agree safety exceptions explicitly. Passwords, expired security challenges or designated sensitive values may need clearing rather than restoration. Identify which values, under what conditions and how the visitor will be told. Explain before a destructive action where feasible; do not use a vague security rationale to excuse unexpected loss of ordinary enquiry text.

Attachments need separate rules. After navigation or reload, the visitor may need to select the file again. A displayed filename must not imply that usable file contents remain available unless that state has been verified.

3. Specify the combined failure in a filled recovery table

Fictional worked example: A business enquiry form contains name, email, enquiry type, message and an optional PDF attachment. Its hypothetical size rule accepts PDFs up to and including 5 MB. The implementation must define the byte threshold consistently across the displayed rule and validation checks.

In this hypothetical attempt, Maya Patel selects “Project enquiry,” enters “maya@” and writes “Please quote for replacement shelving. Access is through the rear entrance.” She selects a 6 MB PDF. Both the invalid email and oversized attachment are known at the first validation result, so the summary must identify both.

Maya then corrects her email to “maya@example.com” before replacing the attachment with a 4 MB PDF. The first two rows below are successive states of that same attempt. The remaining rows specify later failure branches after both inputs have been corrected.

Filled hypothetical enquiry-form recovery specification
TriggerPreserved valuesRevised copyNext actionPass condition
Initial validation: invalid email and oversized PDFKeep name, maya@, enquiry type and the complete message. Show the rejected PDF as not attached.Summary: Your enquiry has not been submitted. Check the email address and attachment below; your written answers are still here.
Email: Enter an email address with a domain, such as name@example.com.
Attachment: This PDF exceeds 5 MB and was not attached. Choose a PDF of 5 MB or less, or remove it.
Focus a summary with links to both affected controls. Allow correction in either order.Both known errors appear together. Correcting the email removes its error but leaves the attachment error visible. All unrelated answers remain unchanged.
Email corrected; oversized attachment still unresolvedKeep maya@example.com, the name, enquiry type and exact message. Keep the rejected-file state visible.Summary: Your enquiry has not been submitted. Replace or remove the attachment; your written answers are still here.
Attachment: This PDF exceeds 5 MB and was not attached. Choose a PDF of 5 MB or less, or remove it.
Replace the file with the hypothetical 4 MB PDF, or remove the optional attachment.No obsolete email error remains. The attachment error clears only after valid replacement or removal. The email and unrelated answers remain unchanged.
Temporary server failure after corrections, with confirmed non-acceptanceKeep current-page answers. Retain the corrected attachment only if usable; otherwise flag it for reselection.We could not accept your enquiry. Your answers are still on this page. Please try again.
If needed: Select your attachment again before submitting.
Enable another attempt when available. Put any reselection requirement beside the attachment control.Retry uses the corrected email and preserved message. No missing file is silently treated as attached.
No reliable confirmation after a corrected submissionKeep the full written enquiry visible. Show the actual known attachment state.We could not confirm whether your enquiry was received. Your answers are still here. Trying again may send a duplicate.Offer a receipt check only if one exists. Otherwise offer a clearly labelled retry with the warning and a monitored alternative contact route.The page claims neither success nor rejection without evidence. Maya can make an informed next choice.
Session expiry confirmed to have prevented acceptanceIn this hypothetical design, renewal preserves written answers and selections but requires attachment reselection.Your enquiry was not submitted because this session expired. Renew the session to continue. Your written answers will stay here, but you will need to select the attachment again.Provide renewal that honours this promise, then request the file again.The corrected email and shelving message survive renewal exactly. The attachment is not shown as ready until selected again.

Approve each row as a whole. Copy promising preservation is unsuitable if the recovery action clears fields. If session renewal cannot preserve text, replace that promise with a warning and an opportunity to copy the enquiry before leaving.

Reuse this artifact by replacing the example values, permitted file rules and recovery actions with your form's actual requirements. Keep the distinction between simultaneous errors, successive correction states and alternative failure branches.

The attachment copy assumes the rejection reason is known. An unsupported file type needs a type-specific message. If the reason is unavailable, use an explicitly generic fallback: “This file could not be attached. Check that it is a PDF of 5 MB or less, then try again, or remove it.” Do not label an unknown upload failure as a confirmed size violation.

4. Connect errors to the controls that need attention

A red outline cannot explain a problem or its correction. Keep a visible label, place actionable guidance near the control and make the relationship available to assistive technology.

The W3C guidance on form labels explains programmatic association between labels and controls. With an explicit label, its for value matches the input's ID. Preserve that association when adding an error message.

After an unsuccessful submission, provide a summary naming all known affected fields and linking to them. Make the changed state discoverable to keyboard and screen-reader users rather than relying on colour or a banner outside the current view. Avoid competing focus changes that move someone to the summary and immediately pull them elsewhere.

Allow visitors to finish entering a value before interrupting with correction guidance. Accommodate reasonable input variations rather than rejecting harmless formatting. Clear obsolete errors once resolved without removing other unresolved errors. As W3C's validation guidance explains, client-side checks do not replace server-side validation. Recovery must also work when the server detects the problem first.

5. Make waiting and retry states usable

Only give a waiting period when the service provides a dependable basis for it. An invented countdown creates false precision. If no reliable interval is available, explain the temporary interruption without guessing when it will end.

While submission is pending, show that state and discourage repeated activation of Submit. Avoid automatic retry loops that leave visitors unable to tell whether another attempt is running. When the attempt ends, expose the appropriate action rather than leaving a disabled button with no explanation.

Use action labels that describe what happens next: retry submission, renew session or replace attachment. Do not show a receipt-check control, confirmation-email instruction or alternative route unless it actually exists. Keep raw server responses out of visitor-facing copy.

6. Provide an exit when this attempt cannot continue

Some failures cannot be repaired in the current form. Renewal may be unavailable, or repeated attempts may produce no usable result. Give the visitor a way to stop without experimenting indefinitely.

Offer an alternative contact route only if the business monitors it. Explain that the visitor must resend the enquiry there; do not suggest that the failed form already forwarded it. If the route cannot receive attachments, disclose that before the switch.

Where practical, offer an optional way to copy the written enquiry before leaving. Report copying success only after it succeeds, and provide a manual selection fallback. Copying sensitive content onto a shared clipboard may be unsuitable, so do not do it automatically.

Warn before restarting or navigating away if that action will erase answers. A destructive restart should not overshadow an available, less destructive recovery option.

7. Test recovery as a completed task

Use the table as a test script, not merely a copy checklist. Populate fields with recognisably different fictional values, trigger each failure and follow recovery through to acceptance or a clearly explained exit.

  1. Combined correction: Submit Maya's invalid email and oversized PDF together. Confirm both errors appear immediately. Correct only the email and verify that the attachment error remains visible while unrelated answers stay intact. Repeat in the opposite correction order.
  2. Preservation: Compare before-and-after values, including line breaks, selections and invalid entries. Repeat after consecutive errors and after a server-side validation response.
  3. Safety exceptions: Check that deliberate clearing matches the agreed exception and explanation. Confirm ordinary enquiry answers are unaffected.
  4. Attachment accuracy: Verify rejected, uploading, available and reselection states. Test files below, exactly at and above the hypothetical inclusive size threshold, plus an unsupported type.
  5. Accessible correction: Complete the journey by keyboard and inspect how labels, summaries and field messages are exposed to assistive technology.
  6. Outcome accuracy: Interrupt an attempt and check that the page does not invent acceptance or rejection.
  7. Exit behaviour: Follow renewal, retry, copying and alternative-contact actions. Verify each preservation promise before relying on its wording.

For each test, record what survived, which errors remained and whether the next action completed or safely ended the task. Unexplained loss of entered text fails recovery. Intentional clearing passes only when it matches the agreed safety exception and explanation requirement. A correct-looking banner cannot compensate for a broken recovery action.

Lead captureForm designError recoveryAccessibility

Put the next conversation to work.

Explore Alactic Communications for WhatsApp conversations, campaigns and AI-assisted workflows. Choose the product and plan that fit your team.

Explore Communications