Created
August 28, 2024 22:26
-
-
Save mikeoberdick/e0bdd7421c7b30fa165ecc8b1d3b603d to your computer and use it in GitHub Desktop.
Simple form validation where inputs are checked on 'keyup' for value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("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