Pristine
Pristine copied to clipboard
Equals does not work with the current version.
Works with the version included in the codepen. Tried that version locally and works fine. But with the version installed through npm "pristinejs": "^0.1.9"
doesn't work.
Hi @Pixney-William,
Looks like the js file in codepen is pointed to the same file which is in the master branch. Could you please check the diff between the 2 files you have?
Hi @Pixney-William,
Looks like the js file in codepen is pointed to the same file which is in the master branch. Could you please check the diff between the 2 files you have?
So, I downloaded the one from release and does not have equals
.
In my case, I usign the pristine.min.js
from dist
so I have no issues.
@sha256 could you please update both versions (release and npm)?
I still see that the "equals" validation rule has not been included in an official release. Is there any chance of that happening soon? I have also installed Pristine 0.1.9 via npm and that rule is not included and that appears to be the latest release.
Maybe it's obvious and not necessary, but here is small copy-paste piece, re-creating equals validator while problem is resolved.
Pristine.addValidator(
'equals',
function (val, otherFieldSelector) {
var other = document.querySelector(otherFieldSelector);
return other && ((!val && !other.value) || other.value === val);
},
'Fields do not match',
1,
true
);
Here's a "fix" "pristinejs": "git+https://github.com/sha256/Pristine.git"
Use this in your package.json and rerun npm install