#
#
#FFFFFF2017-10-04 12:01:24
Validation
#FFFFFF, 2017-10-04 12:01:24

How with vee validate to check for a mismatch in the value of the fields?

Hello! Maybe someone knows, you need to check for a mismatch between the login and password - that is, as a confirmation of the password, just the other way around, the login should not match the password. If this is a custom error, then it is not entirely clear how to run the check of both fields at the same time.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem0071, 2017-10-04
@Artem0071

Maybe I didn’t understand something, but this is done in easy:

<input v-model="login">
<input v-model="password">
<button @click="regUser()">Зарегестрироваться</button>

<script>
...
methods:{
  regUser(){
    if (this.login == this.password) {
      alert('логин не должен быть равен паролю');
      return;
    }
    // ... остальной код для регистрации
  }
}
...
</script>

J
j-tap, 2019-03-15
@j-tap

v-model='password'

export default {
  data() {
    return {
      email: null,
      password: null,
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question