Skip to content

Is it possible to create custom validators ? and create validator for, eg, two fields ? #178

Description

@julestruong
No description provided.

Activity

  1. julestruong commented on Mar 31, 2016

    @julestruong
    Author

    never mind i found how :

    validators: [(form, field, callback) => {
                    if (field.data !== "ok") {
                        callback("msg error");
                    } else {
                        callback();
                    }
                }]

    U may want to add this in documentation :)

    but still i would love to know how to combine validations for a whole form

  2. ljharb commented on Mar 31, 2016

    @ljharb
    Collaborator

    A PR to improve the documentation is always welcome!

    Validations are performed per-field - you can certainly reuse a validator on as many fields as you like by storing the function in a variable, and passing that variable into multiple fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions