I want to validate the widgets in group. i mean if there are two field at least one field is required. is it possible?
The rules are dynamic, so you could have the required-rule as a computed property, and set to false if any of the other fields are valid.
can you please provide me small example. i have two input field for surname and nickname. but i need at least one value either nickname or surname.
I guess it would be something in the lines of
<input v-validate="surNameRule" id="surName"/>
<input v-validate="nickNameRule" id="nickName"/>
<script>
export default {
....
computed: {
surNameRule() {
return {
required: !this.nickName
};
},
nickNameRule() {
return {
required: !this.surName
};
},
},
.....
};
</script>
@sqpdln Thanks for helping out with the issues!
here is an example: https://jsfiddle.net/logaretm/p0766ckj/1/
Most helpful comment
I guess it would be something in the lines of