Browse Source

Update the tooltip title as current validator error message

nghuuphuoc 12 years ago
parent
commit
a5eff5d319
2 changed files with 2 additions and 1 deletions
  1. 1 1
      demo/index.html
  2. 1 0
      src/js/bootstrapvalidate.js

+ 1 - 1
demo/index.html

@@ -63,7 +63,7 @@ $(document).ready(function() {
                     },
                     regexp: {
                         regexp: /^[a-zA-Z0-9_\.]+$/,
-                        message: 'The username can only consist of alphabetical, number and underscore'
+                        message: 'The username can only consist of alphabetical, number, dot and underscore'
                     }
                 }
             },

+ 1 - 0
src/js/bootstrapvalidate.js

@@ -133,6 +133,7 @@
                 var $tip = $fieldElement.data('bootstrapValidator.tooltip');
                 $tip.find('i').attr('class', this.options.iconClass.invalid).end()
                     .attr('title', message)
+                    .attr('data-original-title', message)
                     .tooltip('show');
             },