Coder Social home page Coder Social logo

Rule confirmed not working about ree-validate HOT 18 CLOSED

Jimmea avatar Jimmea commented on June 12, 2024 2
Rule confirmed not working

from ree-validate.

Comments (18)

Quadriphobs1 avatar Quadriphobs1 commented on June 12, 2024 2

So after serious digging into the library and the whole architecture, I first would like to commemorate @moeen-basra for a good job well done on the package, I know it is not an easy job to maintain an open source project but its a good job done, I give it 👍 . I saw the new revamp branch you were working and its a really huge one, hopefully, someday when am free I can help out on it, hope it welcomed to contribute.

So I was able to solve this by doing some little hack on the. after initializing my setup I had to check my method that call validate and defer the method call on the input I want to do comparison check.

if (name === 'compare') {
  const result = this.validator.rules.confirmed(value, otherValue);
      if (!result) {
        this.validator.errors.add(name, 'Comparison not matched');
      }
} else {
  // normal validator for all input
}

but I am not sure that is going to work for validateAll method though... hopefully that can save someone a day

from ree-validate.

joriling avatar joriling commented on June 12, 2024 1

Still have this issue , Is there other way to fix ?
Thank you

password: 'required',
password_confirmation: 'required|confirmed:password',

from ree-validate.

Quadriphobs1 avatar Quadriphobs1 commented on June 12, 2024 1

Any guide on how you were able to do it @moeen-basra I am trying to use custom rule but I can't figure out how to map the two fields together.
I am having

ReeValidate.extend('confirmation', (value, [otherValue]) => {
  return value === otherValue;
}, {
  hasTarget: true,
});

but my concern is that ref is the approach for vue js which would not work in the react js since react js uses ref for something else internally

from ree-validate.

moeen-basra avatar moeen-basra commented on June 12, 2024

sorry for late response I'll be looking into this.

from ree-validate.

moeen-basra avatar moeen-basra commented on June 12, 2024

Sorry for delay I'm upgrading the project and will publish it soon with complete docs.
I'm afraid to tell confirm will not work for now as it is written for vue js, for the time being you can do a manual compare for password.

from ree-validate.

Jimmea avatar Jimmea commented on June 12, 2024

from ree-validate.

sirpeas avatar sirpeas commented on June 12, 2024

@Jimmea How did you fix it in your project? In my case v3.0.2 it's doesn't work

from ree-validate.

moeen-basra avatar moeen-basra commented on June 12, 2024

You have to do this menually at the moment.

from ree-validate.

moeen-basra avatar moeen-basra commented on June 12, 2024

unfortunately, its not ready yet. you can manually create a function for password fields match.

from ree-validate.

moeen-basra avatar moeen-basra commented on June 12, 2024

I'm also using custom rule for now but working on new release and hope it will resolve all the basic problems.

The actual delay is due to time

from ree-validate.

Quadriphobs1 avatar Quadriphobs1 commented on June 12, 2024

Ohhh.... would be so kind as to share a guide approach to how you were able to solve it... or an approach how think it can be solved... I have trying to understudy the whole codebase to see if I can be of help but I am very tied up to finishing the project am working on now and this is the only delay I am having

from ree-validate.

Quadriphobs1 avatar Quadriphobs1 commented on June 12, 2024

Or if you can tell how to use the after rule then I think I can be able to solve it that way... I have been trying to implement the after rule as well @moeen-basra

from ree-validate.

moeen-basra avatar moeen-basra commented on June 12, 2024

that also am doing manually

from ree-validate.

Quadriphobs1 avatar Quadriphobs1 commented on June 12, 2024

Wow....

from ree-validate.

Quadriphobs1 avatar Quadriphobs1 commented on June 12, 2024

@moeen-basra Please is there any exposed function which can let me get the value of a field by the name I get from the parameter ref[0] it think that should be used internally

from ree-validate.

moeen-basra avatar moeen-basra commented on June 12, 2024

yes ofcourse every single contibution to opensource is valueable. The current version of package was not much modified and so was not very friendly with react except the general rules. But I'm sure the next version will not only work with react out of the box but also with any javascript library.

from ree-validate.

valentinfily avatar valentinfily commented on June 12, 2024

Any update on the above ?
Many thanks

from ree-validate.

lochawala avatar lochawala commented on June 12, 2024

Any update on the above ?
Thanks for great package.

from ree-validate.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.