I have a form and need to check to make sure any child inputs of a fieldset are empty. How can I accomplish this using jQuery?
if any fields with .required are empty
-> there are fields that have not been filled out
if all fields with .required have been filed out
-> they have all been filed out
Select your fields by form id and class name. Then use
.filter()to reduce your set to include only the fields that have not been filled out:If you don’t want to do anything with the fields, but just need a boolean: