how to use validation-messages ? #1388
yogendrarr
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my case,
Below is i am checking photo size if size greter than my provided size then it should return message . so its working fine.
but if file is valid, then it should not show the else custom messege how to do that kind of validations.
i need to forcefully need to return in else part, how to avoid this.
<FormKit validation-visibility="blur" ref="uploadInput" type="file" label="Candidate Photograph" name="photograph" v-model="photograph.file" help="Please upload your photograph" :accept="photograph.mimeType" :validation="[...(isMandatory ? [['required'], ['is']] : [])]" :validation-messages="{ required: 'photograph is required', is: customMessage, }" />
` const customMessage = ({ node }) => {
if (photograph.file !== null) {
let size = node.value[0].file.size / 1000;
Beta Was this translation helpful? Give feedback.
All reactions