ソースを参照

Merge branch 'jcnmulio-master'

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
phuoc 11 年 前
コミット
0c370d8f0b
1 ファイル変更32 行追加0 行削除
  1. 32 0
      src/js/bootstrapValidator.js

+ 32 - 0
src/js/bootstrapValidator.js

@@ -1129,6 +1129,38 @@
                 .removeData('bootstrapValidator')
                 .removeData('bootstrapValidator')
                 // Remove generated hidden elements
                 // Remove generated hidden elements
                 .find('[data-bv-submit-hidden]').remove();
                 .find('[data-bv-submit-hidden]').remove();
+        },
+        
+         /**
+         * Add a new field validation
+         *
+         * @param {String} field The field name
+         * @param {Object} Map the field name with validator rules
+         * 
+         * @return {BootstrapValidator}
+         */
+        addField: function(field, properties) {
+
+            this.options.fields[field] = properties;                    	           
+            this._initField(field);
+            
+            return this;
+                    	            
+        },
+        
+        /**
+         * Remove a field validation
+         *
+         * @param {String} field The field name 
+         * 
+         * @return {BootstrapValidator}
+         */
+        removeField: function(field) {
+
+        	delete this.options.fields[field];
+            
+            return this;
+                    	            
         }
         }
     };
     };