Can't validate 'confirm' on the fly
See original GitHub issueVersions:
- VueJs: 2.0.1
- Vee-Validate: 2.0.0-beta.15
Description:
I’m using simples password confirmation validation and it works. However, it doesn’t work on the fly while users are typing. The first input, the real password, shows the error while typing. The second input, the confirmation password, when type the exact the same as the real password, the error doesn’t go away. However, if I hit submit and force the validation, yes it works.
So, I’m wondering how I would validate it on the fly while type, same behaviour as here http://vee-validate.logaretm.com/rules#rule-confirmed
My code is very simples, something like this
<input v-validate data-vv-rules="required|confirmed:password_confirmation" name="password" type="password" class="form-control"> <input name="password_confirmation" type="password" class="form-control">
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Cool, I understood! For me, in this case, not a big deal to change to v-show. Actually, v-show I think is more correct since there are two containers like tabs that users can navigate.
Tks a lot!
Oh, I see. It is a duplicate of #119
It happens because the additional listener can’t find the target field, because
v-if
doesn’t include the hidden part in the DOM, unlikev-show
which only sets thedisplay
style tonone
but the hidden part is still in the DOM thus it can attach the additional listener.