Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Form passes browser validation but server rejects it: fix

CNV-037High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Most forms check input twice. Client-side validation runs in the visitor's browser (HTML attributes like required and pattern, or JavaScript). Server-side validation runs on your server, CRM or form service after the data is sent. The two sets of rules are written separately, so they drift apart.

Why it costs you leads or sales

The visitor did everything right as far as they can tell. If the server rejects the entry and the page shows a vague error, a spinner that never ends or even a fake thank-you message, they leave. They rarely try again. You never see the lead, and your ad platforms may still record a conversion if the tracking fires on button click rather than on a real success.

Where the lead is lost
  1. Visitor fills formEnters a phone like (555) 010 999
  2. Browser check passesClient rule allows spaces and brackets
  3. Server rejectsServer rule wants digits only, returns 422
  4. Lead saved in CRMNever created
  5. Notification and conversionNever sent

The browser accepts the entry, the server refuses it, and everything after is lost.

Lost submissions by field ruleExample numbers
Lost submissions by field rule (example)Clean test data: 0 %; Phone with spaces: 12 %; Email with +: 3 %; Long names: 2 %05901232Clean test dataPhone with spacesEmail with +Long names%

Example: share of 100 real submissions rejected by the server after passing the browser check. Your numbers will differ.

How to check if your site has it

Find mismatches by hand
  1. List every field and its rules

    For each field write down the client rule (HTML attributes, JavaScript) and the server rule (form plugin settings, CRM field type, backend code or API docs).

  2. Open DevTools on the Network tab

    Submit the form and look at the request. A 400, 422 or an error body in the response means the server refused it.

  3. Try realistic edge cases

    Use a phone with spaces, dashes and a country code, an email with a plus sign, a name with an apostrophe or accent, a long message, and a postcode with a space.

  4. Check what the visitor sees

    Note whether the page shows a clear error, nothing, or a false success message.

  5. Compare with your CRM

    Confirm each test submission that looked successful really arrived in the inbox and CRM.

Typical mismatches to test
FieldBrowser allowsServer may refuse
PhoneSpaces, brackets, + prefixAnything but digits
Emailname+tag@domain.com, new TLDsPlus sign or long TLD
NameApostrophes, accents, any lengthLetters only or short max length
MessageUnlimited textMax length such as 500 characters
DropdownOld option still in the pageValue no longer in the allowed list

How to fix it

The principle: the server is the source of truth. Make the browser rules match it, or loosen the server rules so valid entries are accepted. Then make sure any server error is shown clearly on the page.

Align the rules on your platform
  1. Check the form plugin's field settings

    In plugins such as Contact Form 7, Gravity Forms or WPForms, open the field and compare its validation or input mask with any custom JavaScript or theme code on the page.

  2. Remove duplicate rules

    If a theme or snippet adds its own pattern or script check, delete it so the plugin's rules are the only ones.

  3. Show server errors

    Make sure the plugin's error messages are enabled and not hidden by theme CSS.

Show server errors instead of failing silentlyjavascript
const res = await fetch(form.action, { method: 'POST', body: new FormData(form) });
if (!res.ok) {
  const data = await res.json().catch(() => ({}));
  const errors = data.errors || {};
  Object.keys(errors).forEach((name) => {
    const field = form.elements[name];
    if (field) field.setCustomValidity(errors[name]);
  });
  form.reportValidity();
  return;
}
showThankYou();
Phone field example

Mismatched

  • Browser accepts (555) 010 999
  • Server accepts digits only
  • Visitor sees a generic error or nothing

Aligned

  • Both sides accept spaces, brackets and +
  • Server strips formatting before saving
  • Any rejection shows a clear message by the field

How to confirm it's fixed

Confirmation checks
  • Submit every edge case from your table and see each one reach the inbox and CRM
  • Network tab shows a success response, not 400 or 422
  • A deliberately invalid entry shows a clear error next to the field
  • The thank-you message appears only after the server accepts the entry
  • Conversion tags fire only after a real success

How to prevent it happening again

Habits that keep rules in sync
  • Keep one written list of field rules and update it whenever a form, plugin or CRM field changes
  • Retest the form after any CRM, plugin or theme update
  • Test with messy real-world data, not only clean sample entries
  • Show server error messages on the page
  • Schedule an automated end-to-end test of the form
How the mismatch usually appears
  1. Day 1

    Form is built and tested with clean data. It works.

  2. Week 4

    CRM field is changed to digits only. Browser rules are untouched.

  3. Week 5

    Visitors who type spaces in the phone number are rejected. Nobody notices.

  4. Week 8

    Lead numbers look low. Someone finally checks the Network tab.

See what a rule mismatch doesInteractive
Server rule stricter than browser rule

Phone number * required

Visitors who start the form and send it (example)

42% send it · example numbers

Entries with spaces pass the browser, the server rejects them and the lead is lost.

Toggle to compare a form with mismatched rules against one with aligned rules.

How FunnelGuard handles this

FunnelGuard detects this issue today. A robot visitor fills in and submits your form on a schedule, then checks for the success state. When the browser accepts the entry but the server refuses it, the success check fails after submit. A failure is re-checked from a second region, and then one alert goes out (email, Slack, Teams, WhatsApp, webhook or PagerDuty) with a screenshot and a likely cause.

Questions people ask

Why does my form pass validation in the browser but fail on the server?

The browser and the server each have their own rules, written separately. If the server is stricter, for example digits-only phone numbers, a value can pass the browser check and still be rejected after submit.

Why is my form submission returning a 422 error?

A 422 usually means the server understood the request but refused the data because it broke a rule. Open the response body in the browser's Network tab to see which field was rejected and why.

Do I need both client-side and server-side validation?

Yes. Client-side checks give visitors quick feedback, while server-side checks protect your data because browser checks can be skipped. They should follow the same rules.

How do I find which field the server is rejecting?

Submit the form with DevTools open on the Network tab and inspect the failed request's response. Many servers list the failing fields. If not, test one field at a time with realistic formats.

Why does my form show a thank-you message but no lead arrives?

The page may show success when the button is clicked rather than when the server accepts the data. Change it to show the message only after a successful response, and check the server's rules for the entries that failed.

How can I test form validation automatically?

Run an end-to-end test that submits the form with realistic data and checks for the success state and the lead in your inbox or CRM. FunnelGuard does this on a schedule and alerts you when the success check fails.

Should the server fix the data or reject it?

For harmless formatting, such as spaces in a phone number, it is better for the server to clean the value and accept it. Reject only data that is truly unusable, and always return a clear message.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: success assert fails after submit.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.