Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4535284
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:23:10+00:00 2026-05-21T14:23:10+00:00

I have my form broken up into sections, and I’m trying to have a

  • 0

I have my form broken up into sections, and I’m trying to have a script check the number of fields empty in each section. Previously I had written an array with the id’s of each section and had it cycle through that array, but i’d like to find a more universal solution that doesn’t depend on predefined data.

at first I was trying .find() like so

function blankFields(section){
    var totblank = 0;
    var inputs = $('#' + section).find('input');
    $.each(inputs, function(){
        if(this.val() == '') { totblank++; );
    }

when that didn’t work i tried .serializeArray()

function blankFields(section){
    var totblank = 0;
    var inputs = $('#' + section + ' input').serializeArray();
    $.each(inputs, function(i, field) {
        if (field.value == '') { totblank++; }
    });

and it gets followed up with

    if(totblank > 0){
        $("#"+section+"B").html(totblank+" Empty");
    } else {
        $("#"+section+"B").html("All full!");
    }       
}

section is the id of a div, the div has a table with form inputs.

This is my first time using these functions so I’m not really sure where I’m going wrong. Feels like I’m expecting the output to be something its not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:23:10+00:00Added an answer on May 21, 2026 at 2:23 pm

    There are a few syntax errors in your code. Fixed:

    function blankFields(section){
       var totblank = 0;
       var inputs = $('#' + section).find('input');
       inputs.each(function(){
          if($(this).val() == '') totblank++;
       });
    
       alert(totblank); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that I'm trying to create which is broken up into
I have a form broken into 5 steps. Currently if you refresh/exit/close etc on
I'm wondering. If I have a form that is broken up into steps where
I have a form that is broken down into three different categories: Information, Violations,
I want to have a large HTML form broken up into several smaller sub-forms
I have a long form that I've broken up into 6 steps. When the
I have form and some fields and I want send these fields to the
I have form, where some fields are looks like rows, so I can add/delete
We have a code base broken up into static libraries. Unfortunately, the libraries have
Can ayone explain why my form is broken in Firefox? I have tried various

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.