Skip to content

Always use data-pristine-attribute if the 2 variants of the attribute exists#98

Open
soleneggd wants to merge 1 commit into
sha256:masterfrom
soleneggd:data-pristine-attr
Open

Always use data-pristine-attribute if the 2 variants of the attribute exists#98
soleneggd wants to merge 1 commit into
sha256:masterfrom
soleneggd:data-pristine-attr

Conversation

@soleneggd

Copy link
Copy Markdown

The issue is explained here #96.

@1ucay

1ucay commented May 25, 2024

Copy link
Copy Markdown

for me not working...my code, where pattern order doesn't matter. tag pattern is fallback, where JS can be disabled.

<input type="text" name="first-name" required autocomplete="given-name" pattern="[\p{sc=Latin}\p{M}\s\-,.']+" data-validate-pattern="/^[\p{L}\p{M}\s,.'-]*$/gu">

self.fields = Array.from(form.querySelectorAll(SELECTOR)).map(function (input) {
  var fns = [];
  var params = {};
  var messages = {};

  [].forEach.call(input.attributes, function (attr) {

    var nameClean = attr.name.replace( 'data-validate-', '' );
    if ( attr.name === nameClean && input.attributes.getNamedItem("data-validate-" + nameClean )) return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants