Browse Source

#191, #223: Support using both the ```name``` attribute and ```selector``` option for field

nghuuphuoc 11 years ago
parent
commit
07640a044f

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 # Change Log
 
+## v0.4.4 (not released yet)
+
+* [#191](https://github.com/nghuuphuoc/bootstrapvalidator/issues/191), [#223](https://github.com/nghuuphuoc/bootstrapvalidator/issues/223): Support using both the ```name``` attribute and ```selector``` option for field
+
 ## v0.4.3 (2014-04-26)
 
 * [#77](https://github.com/nghuuphuoc/bootstrapvalidator/issues/77): Add [```file``` validator](http://bootstrapvalidator.com/validators/file/)

+ 1 - 1
bootstrapValidator.jquery.json

@@ -1,6 +1,6 @@
 {
     "name": "bootstrapValidator",
-    "version": "0.4.3",
+    "version": "0.4.4-dev",
     "title": "BootstrapValidator",
     "author": {
         "name": "Nguyen Huu Phuoc",

+ 1 - 1
bower.json

@@ -1,7 +1,7 @@
 {
     "name": "bootstrapValidator",
     "description": "The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3",
-    "version": "0.4.3",
+    "version": "0.4.4-dev",
     "main": [
         "dist/css/bootstrapValidator.css",
         "dist/js/bootstrapValidator.js"

+ 1 - 1
dist/css/bootstrapValidator.min.css

@@ -3,7 +3,7 @@
  *
  * A jQuery plugin to validate form fields. Use with Bootstrap 3
  *
- * @version     v0.4.3
+ * @version     v0.4.4-dev
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT

+ 2 - 2
dist/js/bootstrapValidator.js

@@ -3,7 +3,7 @@
  *
  * A jQuery plugin to validate form fields. Use with Bootstrap 3
  *
- * @version     v0.4.3
+ * @version     v0.4.4-dev
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT
@@ -265,7 +265,7 @@
                     $message = this.options.fields[field].container ? $parent.find(this.options.fields[field].container) : this._getMessageContainer($field);
 
                 // Set the attribute to indicate the fields which are defined by selector
-                if (!$field.attr('data-bv-field')) {
+                if (this.options.fields[field].selector) {
                     $field.attr('data-bv-field', field);
                 }
 

File diff suppressed because it is too large
+ 2 - 2
dist/js/bootstrapValidator.min.js


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name": "bootstrapValidator",
-    "version": "0.4.3",
+    "version": "0.4.4-dev",
     "description": "The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3",
     "keywords": ["jQuery", "plugin", "validate", "validator", "form", "Bootstrap"],
     "author": {

+ 1 - 1
src/js/bootstrapValidator.js

@@ -264,7 +264,7 @@
                     $message = this.options.fields[field].container ? $parent.find(this.options.fields[field].container) : this._getMessageContainer($field);
 
                 // Set the attribute to indicate the fields which are defined by selector
-                if (!$field.attr('data-bv-field')) {
+                if (this.options.fields[field].selector) {
                     $field.attr('data-bv-field', field);
                 }