Skip to content

revalidate Method Focuses Field Instead of Showing Errors  #155

@mdalaminbey

Description

@mdalaminbey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions