Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
This is a follow on from the issue in https://www.drupal.org/project/webform/issues/3253167 where we integrate select2 into clientside validation. Clientside validation adds error class to the select element, but we need it on the select2 element so that we can theme it nicely.
Proposed resolution
Add this via the jquery.
See patch attached, which applies after the previous patch, or to 6.1.x branch currently.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3254460-5.patch | 1.91 KB | jrockowitz |
#2 | webform-clientside-validation-error-class-3254460.patch | 902 bytes | NewZeal |
Comments
Comment #2
NewZeal CreditAttribution: NewZeal at Passing Phase Web Development for Fuzion commentedComment #3
NewZeal CreditAttribution: NewZeal at Passing Phase Web Development for Fuzion commentedComment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedWe should add some default .error styles for select2 and chosen in webform_clientside_validation.ife.css? I think just a 1px red border should be enough.
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedBesides adding some default styles, I was able to remove the .error class and hide the message when the element is valid.
It is going to be tricky to unset the error styles onchange.
Comment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented