verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 68 forks source link

Whitespace saved into dropdown value causing required field to be valid on submit #1929

Closed strandofgenius closed 1 week ago

strandofgenius commented 1 week ago

Describe the bug

Following up for a discussion on discord regarding lingering white space causing a form submission to be valid if a required drop down field option has a value that contains a space.

Just for fun I did test to see if it affects other fields. I set the default value of a name field to a space and submitted the form on the front end and it said the submission was successful.

Steps to reproduce

  1. Create a form
  2. Add a required dropdown
  3. Add a default option and add a space as the value

Form settings

Craft CMS version

4.8.6

Plugin version

2.1.9

Multi-site?

no

Additional context

No response

engram-design commented 1 week ago

So I can't replicate that on any of the options-based fields, but I also note that you're still on 2.1.9, and I believe that's been fixed in 2.1.15.

But yes, good call on other fields. Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.18".

engram-design commented 1 week ago

Fixed in 2.1.19