custom error message
#4405
-
Hi, I want to check if the username exists in the database and shows the custom error message out of the form as well as put it align with the inline error message. Can you please suggest how to do this, please share the example. Thanks, |
Beta Was this translation helpful? Give feedback.
Answered by
jorisre
Mar 10, 2021
Replies: 1 comment 1 reply
-
Hi @cullsin Here is an example: <input
name="test1"
ref={
register({
validate: {
asyncValidate: async value => await checkUserExist(value) // Returns either `true` if ok either a string if nok :`User doesn't exist`
}
})
}
/> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bluebill1049
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @cullsin
Here is an example: