mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-25 11:04:09 +03:00
improved detection of empty fields.
This commit is contained in:
parent
3a524fab83
commit
b06a754844
|
@ -31,14 +31,14 @@ $(function (){
|
|||
});
|
||||
|
||||
$(document).on("keyup change", ".form-control", function() {
|
||||
if ($(this).val() !== "") {
|
||||
$(this).removeClass("empty");
|
||||
} else {
|
||||
$(this).addClass("empty");
|
||||
}
|
||||
});
|
||||
$(document).on("keydown change", ".form-control", function() {
|
||||
$(this).removeClass("empty");
|
||||
var self = $(this);
|
||||
setTimeout(function() {
|
||||
if (self.val() === "") {
|
||||
self.addClass("empty");
|
||||
} else {
|
||||
self.removeClass("empty");
|
||||
}
|
||||
}, 1);
|
||||
});
|
||||
$(document)
|
||||
.on("focus", ".form-control-wrapper.fileinput", function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user