Just-validate
Just-validate copied to clipboard
revalidate Method Focuses Field Instead of Showing Errors
trafficstars
When calling revalidate, the input gets focused, but validation errors are not displayed unless the form is submitted.
Steps to Reproduce:
- Initialize JustValidate with validation rules:
const validation = new JustValidate('#form'); validation.addField('#email', [ { rule: 'required', errorMessage: 'Email is required' }, { rule: 'email', errorMessage: 'Invalid email format' }, ]); validation.revalidate(); - Call
validation.revalidate(). - The field is focused, but no error message is displayed.
Expected Behavior:
revalidate should validate the field and display the error message immediately without focusing the field.
Hi @mdalaminbey!
I have encountered the same issue. In version 4.1.0, the revalidate method still shows the error message. Do you find a workaround on version 4.3.0?
#169
@mdalaminbey