Skip to content

Instantly share code, notes, and snippets.

@ihorduchenko
Created November 7, 2017 09:26
Show Gist options
  • Save ihorduchenko/e6d0ce9a901e25403341b46123109676 to your computer and use it in GitHub Desktop.
Save ihorduchenko/e6d0ce9a901e25403341b46123109676 to your computer and use it in GitHub Desktop.
Disable submit button while filling form fields
$(document).ready(function () {
$('.submit-btn').prop('disabled', true);
$('.form-field').keyup(function () {
$('.form-field').each(function () {
$('.submit-btn').prop('disabled', this.value == "" ? true : false);
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment