-
Hi, Thanks for this great validation tool. I have one question regarding a custom validation rule. I would like to validate a field by calling my server to check the unicity of the data (a page url). Currently my form field and validation looks like: const { value: pageURL, errorMessage: pageURLError } = useField('pageTemplate',
yupString().
required('Hey, you need to choose a page URL.').
min(3, 'Your page URL must be at least 3 characters long.').
max(30, Your page URL must be 30 characters maximum.').
lowercase().
matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/g, 'Your page URL can only contain letters, numbers and dashes.')
); I've checked the documentation but I don't find how to add this new custom rule. Can you help me? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Well its more related to https://github.com/jquense/yup#mixedtestname-string-message-string--function-test-function-schema |
Beta Was this translation helpful? Give feedback.
Well its more related to
yup
than vee-validate, so searching there would yield better results.https://github.com/jquense/yup#mixedtestname-string-message-string--function-test-function-schema