Clientside Validation is a really useful module, however we had a need to modify the data attributes for other clientside libraries. Would it be plausible to make the data attributes configurable, or is this beyond the scope of the module.

Thanks.
Andy Whale

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andywhale created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, add-data-attribute-overrides.patch, failed testing.

nikunjkotecha’s picture

Status: Needs work » Postponed (maintainer needs more info)

Hi @andywhale,

You can easily achieve this by implementing your own rule/plugin implementation of type CvValidator.

Thanks,
Nikunj

andy_w’s picture

Unfortunately implementing our own wouldn't give us the override required, for example to function as an intermediate layer between webform and parsley.

andy_w’s picture

FileSize
1.38 KB

Error located in patch.

nikunjkotecha’s picture

Status: Postponed (maintainer needs more info) » Needs work

@andy_w

IMO we should add this to annotation and allow it to be configurable per rule to allow overriding for specific rules wherever required, does that approach make sense to you?

About the patch (in-case you still want to continue with this approach):
1. Any specific reason to use t()?
2. Can you please add the config in yaml with default value (used today), an update hook to initialise and update schema?

nikunjkotecha’s picture

Status: Needs work » Postponed
andy_w’s picture

Status: Postponed » Needs review
FileSize
6.79 KB

Added a configuration form, and removed "t" method and replaced with prefix / suffix (and added config defaults).

Though I am intrigued by the annotation suggestion, if we wanted to affect all of the various validators in use by webform, would we just need to add a full custom set of validators.

Status: Needs review » Needs work
andy_w’s picture

Fixed issues / added schema (missed from previous comment)

andy_w’s picture