浏览代码

Update the tooltip title as current validator error message

nghuuphuoc 12 年之前
父节点
当前提交
a5eff5d319
共有 2 个文件被更改,包括 2 次插入1 次删除
  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');
             },