Forms: Empty required choice fields cause form submission to 404 #41969
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] Low
[Status] In Progress
Triaged
[Type] Bug
When a feature is broken and / or not performing as intended
Impacted plugin
Jetpack
Quick summary
When building a form, if you add any field that takes one or more choices (multiple checkboxes, radio buttons, dropdown), make that selection required, but don't add any options to choose from, the form becomes unusable. There are no options to select for the required field, but instead of showing an error about missing required fields, the form appears to submit and redirects to a 404 error.
Only tested so far on Dotcom Simple. Initial report in 9436738-zd-a8c.
Steps to reproduce
Steps to reproduce
Block code sample:
What I expected
For other required fields, an error is shown letting the submitter know that the field is required (
Please fill out this field.
/Please make sure all fields are valid. You need to fix x error(s).
). There should be a similar error in this instance as well.Ideally, it should be impossible to save a form with an invalid multi-input like this, especially if it's marked as required.
What actually happened
The form appears to submit, but redirects to
/?page=1#contact-form-{page-ID}
, which doesn't exist (error 404).Site owner impact
Fewer than 20% of the total website/platform users
Severity
Moderate
What other impact(s) does this issue have?
No revenue impact
If a workaround is available, please outline it here.
Removing the offending block, marking it as not required, or adding 1 or more options to choose from fixes the issue.
Platform (Simple and/or Atomic)
Simple
The text was updated successfully, but these errors were encountered: