kazupon / vue-validator

:white_check_mark: Validator component for Vue.js
MIT License
2.19k stars 431 forks source link

Disable validation in a form field. #134

Closed lionellbriones closed 8 years ago

lionellbriones commented 8 years ago

How can i disable validation on "v-validate:addon" if water is select? I tried to use v-if instead of v-show to hide the input field but it causes the radio buttons to stop changing values. v-show only hides the field but keeps the validation on check.

Please check the jsfiddle code. thanks!

https://jsfiddle.net/llenoil/jLq9bukk/

kazupon commented 8 years ago

v-if directive is terminal directive , and it is higher than v-validate directive. for this reason, when you specify v-if directive on the input tag which was specified v-validate directive, it does not work.

I came up with solution this issue. https://jsfiddle.net/kazupon/yoobf7zd/1/

I hope my solution is useful for you. :smile_cat:

neekychan commented 8 years ago

Have anyother best solution?Have anyother best solution?

kazupon commented 8 years ago

I'll try to implement at v3.0.

kazupon commented 8 years ago

released v3.0.0-alpha.1 https://github.com/vuejs/vue-validator/releases/tag/v3.0.0-alpha.1