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

140
Views
Change css with if statement without submitting button

I am creating an user register form with usernames just like Instagram where the website automatically checks if your input (username) already exists in the database and if it exists its changing the css after a second by example a font awesome icon checked and font awesome icon cross / times, how can i do this without using a submit button?

the code i have now is:

<form method="post"> <div class="field">
  <span class="fas fa-user"></span>
    <input name="email" required type="text" value="<?php if(isset($_COOKIE["email"])) { echo $_COOKIE["email"]; } ?>">
           <label>Username</label>
           <span id="<?php **wait 1 second and if input (username) is in database change the css to "cross" else if username is not in database change the css to "checked" **  ?>"></span>
                        </div> </form>

so the part I need help with is defining the input so i can check it without the use of a submit button. I do not need helping with checking in the database and changing the css state

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!