Created
December 22, 2014 12:08
-
-
Save erezLieberman/80e7a52bab73ec350be9 to your computer and use it in GitHub Desktop.
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
//disable the submit btn when input field empty | |
$('input.search-field').mousemove(function() { | |
var empty = false; | |
$('.search-field').each(function() { | |
if ($(this).val().length == 0) { | |
empty = true; | |
} | |
}); | |
if (empty) { | |
$('.search-submit').attr('disabled', 'disabled'); | |
console.log('cant submit'); | |
} else { | |
$('.search-submit').removeAttr('disabled'); | |
console.log('can submit'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment