Coder Social home page Coder Social logo

Comments (7)

NewOldMax avatar NewOldMax commented on September 26, 2024 1

From version 0.4.3 you can use isFormValid method

from react-form-validator-core.

NewOldMax avatar NewOldMax commented on September 26, 2024

Hi,
for now you can do something like this

<ValidatorForm ref={r => (this.form = r)} >


runFormvalidation = () => {
    const result = this.form.walk(this.form.childs); // result will be true or false
}

from react-form-validator-core.

vineet-agrawal96 avatar vineet-agrawal96 commented on September 26, 2024

Hi

I called runFormvalidation function from render method then showing continuously warning.

runFormvalidation = () => { if(!isEmpty(this.refs)){ const result = this.refs.form.walk(this.refs.form.childs); // result will be true or false return result } }

warning.js:33 Warning: setState(...): Cannot update during an existing state transition (such as within render or another component's constructor)

from react-form-validator-core.

NewOldMax avatar NewOldMax commented on September 26, 2024

As you can see in your warning message, you shouldn't call this function in render method. You should do it in some event action, like onChange

<ValidatorForm onChange={this.runFormvalidation} />

from react-form-validator-core.

pavanshinde47 avatar pavanshinde47 commented on September 26, 2024

@NewOldMax Thanks

from react-form-validator-core.

arosas-atix avatar arosas-atix commented on September 26, 2024

@NewOldMax Hi, I'm currently using the library at the latest version (0.4.4), and I couldn't find a way to use that method, since it's not exposed in the react class. Could you please post an example of how to use it?
I tried using it the same way as addValidationRule

from react-form-validator-core.

NewOldMax avatar NewOldMax commented on September 26, 2024

@arosas-atix

<ValidatorForm
    ref={r => (this.form = r)}
>

...

this.form.isFormValid();

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.