Pristine icon indicating copy to clipboard operation
Pristine copied to clipboard

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

Open soleneggd opened this issue 2 years ago • 1 comments

The issue is explained here #96.

soleneggd avatar Jul 27 '23 15:07 soleneggd

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;

1ucay avatar May 25 '24 11:05 1ucay