Checkboxes Other duplicate validation errors when only selecting 'Other' and leaving 'Other Text Input' field blank

Created on 19 October 2022, over 2 years ago
Updated 19 March 2025, about 2 months ago

Problem/Motivation

For element type "Checkboxes Other" when a user selects only "Other" from the available options, they are presented with a "Other: Text Input" field, if the user leaves the "Other: Text Input" field empty and selects NEXT on the form, validation occurs and shows 2 errors, one for the "Other: Text Input" field and another for the entire field/element on the form.

If the user left the "Other: Text Input" field empty, then they should only get a validation error for that field. They should not get 2 duplicate validation error messages.

See image below of the duplicate error messages:

Steps to reproduce

Create a new "Checkboxes Other" element with a handful of options. Be sure it is a required field. Be sure that a text input field is displayed when selecting "Other" option. SAVE the element.

On the form select "Other" option for the newly created field. Leave the text input field blank and select NEXT (assuming you are using wizard pages). You will see 2 validation errors under the same field, one seems to be for the empty text input field and the other for the entire field itself.

Proposed resolution

Validation should check if the "Other: Text Input" field is empty if the "Other" option is selected. It should then throw a validation error for the "Other: Text Input" field itself and not the entire element.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Needs work

Version

6.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kaise.lafrai Virginia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡±Netherlands tess bakker

    Found a way to reproduce the issue:

    1. Import yml file in the attachment
    2. Test form, select option b
    3. Select option 'Other...'
    4. Submit form
    5. Error 'Other req if B field is required. ' is visible two times

    A workaround for this issue is to change the 'wrapper type' to 'fieldset', the option can be found under the advanced tab of the form element.
    Or remove the `#wrapper_type` from the config file.

    The conditions are maybe not needed, but didn't test that.

  • πŸ‡³πŸ‡±Netherlands tess bakker

    The above workaround works only for Olivero, if you change the theme to Claro, the message is duplicated again.

    Maybe a feature or bug in Olivero?

Production build 0.71.5 2024