Git Product home page Git Product logo

react-validation-utils's People

Contributors

bondom avatar kazimirkas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cstpraveen

react-validation-utils's Issues

Write additional default rules

I think we need to implement default rules for some cases, such as:

  1. email
  2. Date: moreThanDate, lessThanDate....

OR if you have some lightweight libraries that give such functional please link them there

Add method to get status of field

In some cases input have 3 states(statuses) in design. These 3 states correspond to states saved in validationStorage, for now I can get status of field with such hack:

  getFieldStatus = fieldName => {
    const statuses = this.state.validationStorage[fieldName];
    if (statuses.indexOf('validation-failed') !== -1) {
      return 'validation-failed';
    }

    if (statuses.indexOf('prevalidation-failed') !== -1) {
      return 'prevalidation-failed';
    }

    if (statuses.indexOf('validation-passed') !== -1) {
      return 'validation-passed';
    }
  };

I think it will be cool to implement such method in Validator

And of course this hack works only in this version, in next version validationStorage will be hidden inside library, so we need to implement such method in feature/2.0 branch

How to implement when there are more than one form?

Can you just give me an example if there are more than one form? How can we handle it separately? I have tried starting the state such as state={form1: Validator.addValidation({ username: '' });} . But it was showing some error.

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.