Skip to content

Forms: required form fields allow empty submission #43028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yashitamittal11 opened this issue Apr 11, 2025 · 6 comments
Open

Forms: required form fields allow empty submission #43028

yashitamittal11 opened this issue Apr 11, 2025 · 6 comments
Labels
[Block] Contact Form Form block (also see Contact Form label) Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Contact Form [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Status] Escalated to Product Ambassadors [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@yashitamittal11
Copy link

yashitamittal11 commented Apr 11, 2025

Impacted plugin

Jetpack

Quick summary

Users can submit forms even when required fields are left empty, despite those fields being marked as required in the form settings. Link to contact form- https://tenniswithglenn.com/contact-us/

Image

Internal discussion: p1744263369807919-slack-C0160HSMDQV

Steps to reproduce

We are not able to reproduce this issue on our end. However, the user received empty field submissions for the required field in 9633561-zen.

When I enter random text in the date field, the form correctly shows an error about the date being invalid. However, the user received form submissions where the message field was empty and the date field contained invalid date.

Site owner impact

Fewer than 20% of the total website/platform users

Severity

Minor

What other impact(s) does this issue have?

No response

If a workaround is available, please outline it here.

No response

Platform (Simple and/or Atomic)

No response

@yashitamittal11 yashitamittal11 added [Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels Apr 11, 2025
Copy link
Contributor

Support References

This comment is automatically generated. Please do not edit it.

  • 9633561-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" label Apr 11, 2025
@jeherve jeherve added Triaged [Pri] High and removed Needs triage Ticket needs to be triaged [Pri] Low labels Apr 11, 2025
@matticbot matticbot added the [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack label Apr 11, 2025
@jeherve
Copy link
Member

jeherve commented Apr 11, 2025

cc @Automattic/zap That seems like a recent regression that may have been introduced by a recent PR?

@jeherve jeherve changed the title Required Form Fields Allow Empty Submission Forms: required form fields allow empty submission Apr 11, 2025
@simison
Copy link
Member

simison commented Apr 11, 2025

Haven't had luck with replicating or figuring out what's going on:

  • Checked that forms JS (which does validation) exists on the site, and it clearly runs when I hit submit:
    Image
  • Checked that CSS selectors and required attributes needed for the validation are present on each input at the site
  • Tested locally with forms created via block and with classic editor, using old TwentyTwentyTen theme
  • Tested re-creating the form on their site with dropdowns, date etc
  • Tested safari

@simison
Copy link
Member

simison commented Apr 11, 2025

Lowered to normal-prio because this isn't globally broken to everyone.

We also cover this with tests

@ariel-maidana
Copy link

In the page https://tenniswithglenn.com/contact-us/ the "Message" textarea has unusually long name and id attributes --and possibly corrupted.

name="DOCTYPEhtmlhtmllangenheadmetacharsetUTF-8metanameviewportcontentwidthdevice-widthinitial-scale10titleCustomInputPlaceholdertitlestyleitalic-placeholderplaceholderfont-styleitalicstyleheadbodyforminputtypetextclassitalic-placeholderidcustom_inputnamecustom_inputplaceholderEnteryourtexthereformbodyhtml"
id="contact-form-comment-DOCTYPEhtmlhtmllangenheadmetacharsetUTF-8metanameviewportcontentwidthdevice-widthinitial-scale10titleCustomInputPlaceholdertitlestyleitalic-placeholderplaceholderfont-styleitalicstyleheadbodyforminputtypetextclassitalic-placeholderidcustom_inputnamecustom_inputplaceholderEnteryourtexthereformbodyhtml"

I think this might be causing the validation to fail, and allowing messages without content in the required textarea to go through.

I also noticed that the form is not part of the page, but it's in the template instead (Page: Contact-us template).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Contact Form Form block (also see Contact Form label) Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Feature] Contact Form [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Status] Escalated to Product Ambassadors [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended
Projects
Development

No branches or pull requests

6 participants
@simison @jeherve @ariel-maidana @matticbot @yashitamittal11 and others