Its my first time using VeeValidate. How can I enable/disable a form field just when another is valid. For example, just enable password field after veevalidate checks the user field as valid.
0
votes
1 Answers
1
votes
Wrap both relevant fields in a ValidationObserver and use it's scoped prop errors to tell you when the one field is invalid. Something like this (untested):
<ValidationObserver v-slot="{ errors }">
<ValidationProvider vid="item1" rules="required">
<input v-model="item1" />
</ValidationProvider>
<ValidationProvider vid="item2" rules="required">
<input v-model="item2" :disabled="errors.item1"/>
</ValidationProvider>
</ValidationObserver>