Just-validate icon indicating copy to clipboard operation
Just-validate copied to clipboard

revalidate Method Focuses Field Instead of Showing Errors

Open mdalaminbey opened this issue 11 months ago • 1 comments
trafficstars

When calling revalidate, the input gets focused, but validation errors are not displayed unless the form is submitted.


Steps to Reproduce:

  1. 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();
    
  2. Call validation.revalidate().
  3. 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.

mdalaminbey avatar Dec 15 '24 15:12 mdalaminbey

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?

LuisJorgeLozano avatar Jan 22 '25 22:01 LuisJorgeLozano

#169

@mdalaminbey

devShamim avatar Aug 03 '25 05:08 devShamim