I got the reference from How to validate password with Vuelidate?
validations: {
user: {
password: { required,
containsUppercase: function(value) {
return /[A-Z]/.test(value)
},
containsLowercase: function(value) {
return /[a-z]/.test(value)
},
containsNumber: function(value) {
return /[0-9]/.test(value)
},
containsSpecial: function(value) {
return /[#?!@$%^&*-]/.test(value)
},
minLength: minLength(8),maxLength: maxLength(19) },
confirmPassword: { required, sameAsPassword: sameAs("password") },
},
}
<input
:type="passwordFieldType"
v-model="user.password"
v-model.trim="$v.user.password.$model"
id="password"
name="password"
class="input-section-three-login"
:class="{'is-invalid': validationStatus($v.user.password) }"
placeholder="Enter new password"
:maxlength="maxpassword"
v-on:keypress="isPassword($event)"
/>
<button v-on:click="registerMe" :disabled="user.confirmPassword != user.password " :class="(isDisabled) ? '' : 'selected'" > Register
</button>
How to validate the password with vuelidate, i am having regex value in validationStatus and on button click how to check the regex validation.
Trying for if password is validated success with regex validation, move to next screen else till success he need to stay in current screen.