Skip to content

Defer validation until submit is clicked #108

Answered by airjp73
Rocinante89 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! Sorry for the slow answer. You're looking for the validationBehavior option on useField. Usage would be like this:

useField(fieldName, {
  validationBehavior: {
    // Set initial and whenTouched to "onSubmit" and it won't validate until submit
    initial: "onSubmit",
    whenTouched: "onSubmit",

    // If you want this behavior to change after submit, you can change that here
    whenSubmitted: "onChange"
  }
})

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Rocinante89
Comment options

@kwiat1990
Comment options

Answer selected by Rocinante89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants