Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equals does not work with the current version. #37

Open
Pixney-William opened this issue Sep 23, 2020 · 5 comments
Open

Equals does not work with the current version. #37

Pixney-William opened this issue Sep 23, 2020 · 5 comments

Comments

@Pixney-William
Copy link

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.

@sha256
Copy link
Owner

sha256 commented Sep 25, 2020

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?

@tsuginodan
Copy link

tsuginodan commented Oct 20, 2020

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)?

@benjaminkohl
Copy link

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.

@hamsterwork
Copy link

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
);

@kevinmu17
Copy link

Here's a "fix" "pristinejs": "git+https://github.com/sha256/Pristine.git" Use this in your package.json and rerun npm install

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

No branches or pull requests

6 participants