Skip to content

Instantly share code, notes, and snippets.

@tanmay27vats
Created June 14, 2019 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanmay27vats/a290c93c03a555ddf8bde101fc504873 to your computer and use it in GitHub Desktop.
Save tanmay27vats/a290c93c03a555ddf8bde101fc504873 to your computer and use it in GitHub Desktop.
How to check if all inputs are not empty with jQuery
$("input:empty").length == 0;
/* Above statement will bypass the empty spaces. */
/* If you want to search for all empty inputs including blank/empty spaces. Try below one */
$("input").filter(function () {
return $.trim($(this).val()).length == 0
}).length == 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment