mirror of
				https://github.com/mdbootstrap/mdb-ui-kit.git
				synced 2025-11-04 09:57:36 +03:00 
			
		
		
		
	improved detection of empty fields.
This commit is contained in:
		
							parent
							
								
									bf95587330
								
							
						
					
					
						commit
						9f6cbf347e
					
				| 
						 | 
					@ -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() {
 | 
				
			||||||
 | 
					            if (self.val() === "") {
 | 
				
			||||||
 | 
					                self.addClass("empty");
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
            $(this).addClass("empty");
 | 
					                self.removeClass("empty");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
    });
 | 
					        }, 1);
 | 
				
			||||||
    $(document).on("keydown change", ".form-control", function() {
 | 
					 | 
				
			||||||
        $(this).removeClass("empty");
 | 
					 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    $(document)
 | 
					    $(document)
 | 
				
			||||||
    .on("focus", ".form-control-wrapper.fileinput", function() {
 | 
					    .on("focus", ".form-control-wrapper.fileinput", function() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user