Coder Social home page Coder Social logo

Comments (10)

NewOldMax avatar NewOldMax commented on September 26, 2024

Hi,
here is an example with isFormValid function. It disables submit button on invalid state case

from react-form-validator-core.

pavanshinde47 avatar pavanshinde47 commented on September 26, 2024

In my form it showing false even if i fill all the required fields.

from react-form-validator-core.

pavanshinde47 avatar pavanshinde47 commented on September 26, 2024

on onError isn't firing :(

from react-form-validator-core.

NewOldMax avatar NewOldMax commented on September 26, 2024

But it works in example. Maybe you have some issue in your form logic

from react-form-validator-core.

pavanshinde47 avatar pavanshinde47 commented on September 26, 2024

Yeah, I didn't used validateListener, my bad.

from react-form-validator-core.

pavanshinde47 avatar pavanshinde47 commented on September 26, 2024

this.setState({ isFormValid: this.form.isFormValid() }) this works in some cases and others it throws error
Uncaught TypeError: _ValidationRules2.default[name] is not a function

from react-form-validator-core.

NewOldMax avatar NewOldMax commented on September 26, 2024

Can you reproduce it here?

from react-form-validator-core.

pavanshinde47 avatar pavanshinde47 commented on September 26, 2024

Hi @NewOldMax Can you check this example

Here I have used PureComponent and handleError = () => { this.setState({ disabled: !this.form.isFormValid(false) }); };

When i type something, the pages becomes unresponsive, can you help me with why this is happening.

from react-form-validator-core.

mike-strauch avatar mike-strauch commented on September 26, 2024

I think the problem in your example is that you're using handleError as both the form onError handler and also the validatorListener on the field. If you use isFormValid() instead of isFormValid(false) it seems to work ok.

When you call isFormValid(false) that causes the validatorListener to be called on each field and since validatorListener is calling isFormValid you get into an infinite loop.

I haven't seen that other error you mentioned (Uncaught TypeError: _ValidationRules2.default[name] is not a function) in your example after changing the isFormValid(false) to isFormValid().

from react-form-validator-core.

NewOldMax avatar NewOldMax commented on September 26, 2024

Since isFormValid was changed, this issue is not acceptable anymore

from react-form-validator-core.

Related Issues (20)

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.