File tree Expand file tree Collapse file tree 3 files changed +18
-17
lines changed
Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 11# jQuery Validator
22
3- 当前版本: ** 1.3.7 **
3+ 当前版本: ** 1.3.8 **
44
55jQuery Validator 是一个简单易用、功能强大的基于jQuery的表单验证框架。其设计目标如下:
66* 【简单易用,轻松上手】:一般情况下,无需进行任何配置,内置的校验器和校验规则即可满足绝大多数中文环境下的常规表单验证需求,开箱即可使用!
@@ -11,6 +11,6 @@ jQuery Validator 是一个简单易用、功能强大的基于jQuery的表单验
1111## jQuery Validator 依赖
1212jQuery 1.6+(建议采用 1.x 或 2.x 的最新版本)
1313## jQuery Validator 初体验 & 快速入门
14- 演示示例及快速入门教程,请参见网址:[ http ://www.365mini.com/page/jquery-validator-quickstart.htm ] ( http ://www.365mini.com/page/jquery-validator-quickstart.htm " jQuery Validator 快速入门 ") 。
14+ 演示示例及快速入门教程,请参见网址:[ https ://codeplayer.vip/p/j7sud ] ( https ://codeplayer.vip/p/j7sud " jQuery Validator 快速入门 ") 。
1515## jQuery Validator 文档
16- 请参见网址:[ http ://www.365mini.com/page/tag/jquery-validator ] ( http ://www.365mini.com/page/tag/jquery-validator " jQuery Validator 文档 ") 。
16+ 请参见网址:[ https ://codeplayer.vip/p/j7sus ] ( https ://codeplayer.vip/p/j7sus " jQuery Validator 文档 ") 。
Original file line number Diff line number Diff line change 11/**************************************
22 @Name : jQuery-Validator 基于jQuery的前端验证框架
3- @Version : 1.3.7
3+ @Version : 1.3.8
44 @Author : Ready
5- @Date : 2020-08-24
5+ @Date : 2021-11-12
66 @Documentation : https://codeplayer.vip/p/j7sud
77 @Email : CodePlayer360@gmail.com
88 @Licence : https://www.apache.org/licenses/LICENSE-2.0.html
3636 } ,
3737 fn = V . fn = V . prototype = {
3838 // 版本号
39- version : "1.3.6 " ,
39+ version : "1.3.8 " ,
4040
4141 constructor : V ,
4242
694694 }
695695 } ,
696696 // 渲染错误
697- renderError : function ( message , $target , context ) {
698- if ( $target && $target . length && $ . isFunction ( $target . tips ) ) {
699- $target . tips ( message ) ;
700- } else {
701- alert ( message ) ;
697+ renderError : function ( msg , $target , context ) {
698+ if ( $target && $target . length && $ . isFunction ( $target . tips ) && $target . is ( ':visible' ) ) {
699+ // 只有可见的元素才适合使用 tips 方式渲染错误
700+ $target . tips ( msg ) ;
701+ } else {
702+ $ . isFunction ( $ . alert ) ? $ . alert ( msg ) : alert ( msg ) ;
702703 }
703704 var e = context . event ;
704705 if ( ! e || e . type != "focusout" && e . type != "blur" )
786787 getLabel : function ( name , $dom , context ) {
787788 if ( ! name && $dom ) name = $dom . prop ( "name" ) ;
788789 if ( name != null ) {
789- var label = this . labels [ name ] || fn . labels [ name ] ;
790+ var label = context . label || this . labels [ name ] || fn . labels [ name ] ;
790791 if ( label == null && $dom && $dom . length ) {
791792 label = $dom . attr ( this . labelAttr || "label" ) || $dom . first ( ) . prev ( "label" ) . text ( ) ;
792793 }
You can’t perform that action at this time.
0 commit comments