improved detection of empty fields.

This commit is contained in:
Federico Zivolo 2014-09-22 11:39:24 +02:00
parent 3a524fab83
commit b06a754844

View File

@ -31,14 +31,14 @@ $(function (){
}); });
$(document).on("keyup change", ".form-control", function() { $(document).on("keyup change", ".form-control", function() {
if ($(this).val() !== "") { var self = $(this);
$(this).removeClass("empty"); setTimeout(function() {
} else { if (self.val() === "") {
$(this).addClass("empty"); self.addClass("empty");
} } else {
}); self.removeClass("empty");
$(document).on("keydown change", ".form-control", function() { }
$(this).removeClass("empty"); }, 1);
}); });
$(document) $(document)
.on("focus", ".form-control-wrapper.fileinput", function() { .on("focus", ".form-control-wrapper.fileinput", function() {