Browse Source

#1015: remote validator allows to set data options via HTML attributes, thanks to @jazzzz

Phuoc Nguyen 11 years ago
parent
commit
62f92eaa76

+ 1 - 0
CHANGELOG.md

@@ -19,6 +19,7 @@ __Improvements__
 * [#864](https://github.com/nghuuphuoc/bootstrapvalidator/pull/864): Coma separator handling in [greaterThan](http://bootstrapvalidator.com/validators/greaterThan/), [lessThan](http://bootstrapvalidator.com/validators/lessThan/) validators, thanks to [@mgibas](https://github.com/mgibas)
 * [#999](https://github.com/nghuuphuoc/bootstrapvalidator/pull/999): Replace ',' with '.' to validate decimal numbers correct, thanks to [@johanronn77](https://github.com/johanronn77)
 * [#1002](https://github.com/nghuuphuoc/bootstrapvalidator/pull/1002): Put tooltip/popover on bottom if there is not enough space on top, thanks to [@jazzzz](https://github.com/jazzzz)
+* [#1015](https://github.com/nghuuphuoc/bootstrapvalidator/pull/1015): The [remote](http://bootstrapvalidator.com/validators/remote/) validator allows to set ```data``` options via HTML attributes, thanks to [@jazzzz](https://github.com/jazzzz)
 
 __Bug Fixes__
 * [#933](https://github.com/nghuuphuoc/bootstrapvalidator/issues/933), [#959](https://github.com/nghuuphuoc/bootstrapvalidator/issues/959): Tooltip/popover isn't destroyed when the field is valid

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

@@ -2,7 +2,7 @@
  * BootstrapValidator (http://bootstrapvalidator.com)
  * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
  *
- * @version     v0.5.3-dev, built on 2014-10-24 11:29:27 AM
+ * @version     v0.5.3-dev, built on 2014-10-24 11:35:29 AM
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT

+ 7 - 1
dist/js/bootstrapValidator.js

@@ -2,7 +2,7 @@
  * BootstrapValidator (http://bootstrapvalidator.com)
  * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
  *
- * @version     v0.5.3-dev, built on 2014-10-24 11:29:27 AM
+ * @version     v0.5.3-dev, built on 2014-10-24 11:35:29 AM
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT
@@ -5873,6 +5873,7 @@ if (typeof jQuery === 'undefined') {
             name: 'name',
             type: 'type',
             url: 'url',
+            data: 'data',
             delay: 'delay'
         },
 
@@ -5923,6 +5924,11 @@ if (typeof jQuery === 'undefined') {
                 data = data.call(this, validator);
             }
 
+            // Parse string data from HTML5 attribute
+            if ('string' === typeof data) {
+                data = JSON.parse(data);
+            }
+
             // Support dynamic url
             if ('function' === typeof url) {
                 url = url.call(this, validator);

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