mirror of
				https://github.com/mdbootstrap/mdb-ui-kit.git
				synced 2025-10-31 07:57:45 +03:00 
			
		
		
		
	#759 allow validation to be turned off
This commit is contained in:
		
							parent
							
								
									d59aadb9b2
								
							
						
					
					
						commit
						d5a31caff7
					
				|  | @ -30,6 +30,7 @@ | ||||||
|   $.material =  { |   $.material =  { | ||||||
|     "options": { |     "options": { | ||||||
|       // These options set what will be started by $.material.init()
 |       // These options set what will be started by $.material.init()
 | ||||||
|  |       "validate": true, | ||||||
|       "input": true, |       "input": true, | ||||||
|       "ripples": true, |       "ripples": true, | ||||||
|       "checkbox": true, |       "checkbox": true, | ||||||
|  | @ -133,6 +134,7 @@ | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|     "attachInputEventHandlers": function() { |     "attachInputEventHandlers": function() { | ||||||
|  |       var validate = this.options.validate; | ||||||
| 
 | 
 | ||||||
|       // checkboxes didn't appear to bubble to the document, so we'll bind these directly
 |       // checkboxes didn't appear to bubble to the document, so we'll bind these directly
 | ||||||
|       $(".form-group .checkbox label").hover(function() { |       $(".form-group .checkbox label").hover(function() { | ||||||
|  | @ -166,11 +168,13 @@ | ||||||
|         //
 |         //
 | ||||||
|         // NOTE: I'm not sure we should be intervening regarding validation, this seems better as a README and snippet of code.
 |         // NOTE: I'm not sure we should be intervening regarding validation, this seems better as a README and snippet of code.
 | ||||||
|         //        BUT, I've left it here for backwards compatibility.
 |         //        BUT, I've left it here for backwards compatibility.
 | ||||||
|         if(isValid){ |         if(validate) { | ||||||
|           $formGroup.removeClass("has-error"); |           if (isValid) { | ||||||
|         } |             $formGroup.removeClass("has-error"); | ||||||
|         else{ |           } | ||||||
|           $formGroup.addClass("has-error"); |           else { | ||||||
|  |             $formGroup.addClass("has-error"); | ||||||
|  |           } | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|       .on("focus", ".form-control, .form-group.is-fileinput", function() { |       .on("focus", ".form-control, .form-group.is-fileinput", function() { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user