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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

New Zeal created an issue. See original summary.

NewZeal’s picture

NewZeal’s picture

Issue summary: View changes
jrockowitz’s picture

We 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.

jrockowitz’s picture

Status: Active » Needs review
FileSize
1.91 KB

Besides 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.

jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed 120981a on 6.1.x
    Issue #3254460 by New Zeal, jrockowitz: Select2 IFE clientside...

  • jrockowitz committed 120981a on 6.x
    Issue #3254460 by New Zeal, jrockowitz: Select2 IFE clientside...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.