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

100
Views
Show div when all fields are filled

i am trying to show a div when all inputs are filled , but unfortunately it shows nothing here is my JS , it works on the JS FIDDLE but not on the website

$('#name, #prenom, #password,#confirm_password, #email,#confirm_email').bind('keyup', function() {
    if(allFilled())  $('.next2').show();
});

function allFilled() {
    var filled = true;
    $('body input').each(function() {
        if($(this).val() == '') filled = false;
    });
    return filled;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can turn the jQuery collection into an an array and then use the native JS array method every to check to see if all the inputs contain values.

const inputs = $('input');

inputs.on('keyup', function() {

  const notEmpty = inputs.toArray().every(input => {
    return input.value !== '';
  });

  if (notEmpty) {
    $('div').show();
  } else {
    $('div').hide();
  }

});
div { display: none; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input />
<input />
<input />
<input />
<div>All the values!</div>

about 4 years ago · Juan Pablo Isaza Report
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!