Add validation error classes to wrappers of inputs

Created on 10 April 2023, about 1 year ago

Problem/Motivation

Thanks for the great module. We have been using it with great success.

Recently our client felt that some of the error messages on an important webfom were not clear enough for the users. We decided to make the background color of the error messages pink.

It didn't seem like this was doable out of the box so we've patched `cv.jquery.ife.js` to look around for `.error` class on various inputs by type, then go up a parent (or two, depending on the type of input), and add an error class there. I know this isn't the best way to do this, but we're not well-versed in the module, and it's been a bit of a straggler task for us.

Anyway, the form looks great now, and setting the background color on these error messages has been a powerful change. It would be great if this was supported out of the box.

I don't think it is supported out of the box -- because I've only seen the `.error` class on input, and it would need to go on the wrapper elements.

So is there any way to do this already that I've missed?

Is there any desire to build this functionality out so that it's done right? I could help with some time but would need a bit of direction -- maybe just in terms of where things should go. Also maybe so many sites are depending on this module that it might be too big of a change for 4.x.

The approach we've taken is a bit of a hack and we are now seeing some limitations. Like in a required checkboxes field after validation fails on empty result, clicking the first checkbox removes the pink bg but checking any of the others will not.

Proposed resolution

Build in support in this module for the following:

- css error class going into it's wrapper / parent element (not necessarily direct parent)
- css error class being properly removed from wrapper / parent element when validation passes

Remaining tasks

All of it, if anything is even to be done.

User interface changes

There could be a toggle defaulted to off for sites already using the module and sites not looking to use this functionality.

API changes

TBD

Data model changes

TBD

✨ Feature request
Status

Active

Version

4.0

Component

IFE

Created by

πŸ‡¨πŸ‡¦Canada dtarc

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

Comments & Activities

Production build 0.69.0 2024