Fields hidden with conditional don't validate correctly

Created on 28 March 2022, over 2 years ago
Updated 11 April 2023, over 1 year ago

Problem/Motivation

Fields hidden under a contingency field are erroneously "validated" on subsequent "show". My first suspect was clientside_validation. But I don't think so.. it is working exactly as designed. The issue seems to happen only after the contingent field(s) are wrapped with the contingency (in this case, a checkbox).

Steps to reproduce

Installed clean (new) instance of Drupal 9
Installed Webform (v6.1.3)
Installed the clientside_validation module (clientside_validation 3.0.0-rc4)

1. Checkbox
2. Number field
3. email

Under "Conditional logic", configured the number field and the email field to be hidden unless the checkbox is checked
Under Clientside Validation jQuery Settings, enabled Validate on Blur/focusout

1. Click contingency field
2. View correctly displayed contingent fields (i.e., no validation error)
3. Click contingency field closed
4. Contingent fields correctly hidden
5. Click contingency field again (without reloading the form)
6. Contingent fields are marked as an error - failed validation.

Proposed resolution

Do not trigger blur event when opening closing the parent contingency field. Subsequent opens should be the same as the first.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: cannot reproduce

Version

6.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States TMWagner

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.

Production build 0.71.5 2024