Forms: form validation does not work when JavaScript is disabled #41942
Labels
[Block] Contact Form
Form block (also see Contact Form label)
[Feature] Contact Form
[Focus] Accessibility
Improving usability for all users (a11y)
[Package] Forms
[Plugin] Jetpack
Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
[Pri] Low
[Status] Auto-allocated
Triaged
[Type] Bug
When a feature is broken and / or not performing as intended
Impacted plugin
Jetpack
Quick summary
The Form block (and possibly shortcode) usually performs JavaScript form validation. See the accessible-form.js file.
There's also a lot of PHP code for form validation, which is (I assume) for when JavaScript is disabled. See the
Contact_Form_Field->validate
method:jetpack/projects/packages/forms/src/contact-form/class-contact-form-field.php
Lines 204 to 266 in 7a3559d
This PHP validation doesn't seem to work, at least on a block theme. Submitting a form that has validation errors sends the user to a 404 page.
If this needs to be supported, then it looks like something to be fixed. Alternatively, the code could be removed if form validation with JS disabled isn't a feature that needs to be kept.
Steps to reproduce
Expected: The form shows validation errors

Actual: A 404 page is shown. This seems to be because
?page=1
is appended to the URL.Site owner impact
Fewer than 20% of the total website/platform users
Severity
Minor
What other impact(s) does this issue have?
No revenue impact
If a workaround is available, please outline it here.
No response
Platform (Simple and/or Atomic)
Self-hosted
The text was updated successfully, but these errors were encountered: