Skip to content

Instantly share code, notes, and snippets.

@mikeoberdick
Created August 28, 2024 22:26
Show Gist options
  • Save mikeoberdick/e0bdd7421c7b30fa165ecc8b1d3b603d to your computer and use it in GitHub Desktop.
Save mikeoberdick/e0bdd7421c7b30fa165ecc8b1d3b603d to your computer and use it in GitHub Desktop.
Simple form validation where inputs are checked on 'keyup' for value
$("form > input").keyup(function () {
var e = !1;
$("form > input").each(function () {
"" == $(this).val() && (e = !0);
}),
e ? $("#submit").attr("disabled", "disabled") : $("#submit").removeAttr("disabled");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment