password field validation rules:
<!-- Password -->
<label class="form__group is-required">
<span class="form__label">Password</span>
<input
class="form__input"
type="password"
name="form-password"
v-model="password"
@input="$v.password.$touch"
/>
<p v-if="$v.password.$dirty">
<span class="form__alert" v-if="!$v.password.required">Required.</span>
<span class="form__alert" v-if="!$v.password.minLength">
{{ $v.password.$params.minLength.min }} letters at least.
</span>
</p>
</label>
<!-- Repeat Password -->
<label class="form__group is-required">
<span class="form__label">Repeat<br />password </span>
<input
class="form__input"
type="password"
name="form-repeat-password"
v-model="repeatPassword"
@input="$v.repeatPassword.$touch"
/>
<p v-if="$v.repeatPassword.$dirty">
<span class="form__alert" v-if="!$v.repeatPassword.required"
>Required.</span
>
<span class="form__alert" v-if="!$v.repeatPassword.sameAsPassword">
Must be identical.
</span>
</p>
</label>
</div>
</form>
confirm password validation rule:
I want to ensure confirm password matches the 4th character of the original password in Vuejs. Currently, it checks from the beginning and I tried using value.length < 5 but it did not work.
I have implemented vuelidate for input field validations.
https://codesandbox.io/s/stackoverflow-67111603-v9nfc?file=/src/components/HelloWorld.vue:2812-2958