Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
Javascript function doesn't work when chrome auto-fill forms

I have a login form where, if the fields are filled with data, a javascript (jquery) adds a class to them.

The problem appears when the fields are auto-filled by Google Chrome if you save the access credentials. Is there a way to check if Chrome (or any other browser) has autofill the field and launch the JS function so the correct classes are applied?

EDIT giving any input from the keyboard/mouse, the script is fired and it works correctly. Unfortunately, I want it working without user input but o page load.

Example below

main.html

<input type="password" class="input100" name="password">

main.js

$('.input100').each(function(){
        $(this).on('blur', function(){
            if($(this).val().trim() != "") {
                $(this).addClass('has-val');
            }
            else {
                $(this).removeClass('has-val');
            }
        })    
    })
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!