Skip to content

Commit 417b67c

Browse files
committed
修复 pre:flush 时可能导致单选框/复选框等name相同的表单元素的value被修改的bug
1 parent dca9779 commit 417b67c

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# jQuery Validator
22

3-
当前版本: **1.3.4**
3+
当前版本: **1.3.5**
44

55
jQuery Validator 是一个简单易用、功能强大的基于jQuery的表单验证框架。其设计目标如下:
66
* 【简单易用,轻松上手】:一般情况下,无需进行任何配置,内置的校验器和校验规则即可满足绝大多数中文环境下的常规表单验证需求,开箱即可使用!

jquery-validator.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**************************************
22
@Name: jQuery-Validator 基于jQuery的表单验证框架
3-
@Version: 1.3.4
3+
@Version: 1.3.5
44
@Author: Ready
55
@Date: 2017-03-22
66
@Documentation: http://www.365mini.com/page/jquery-validator-quickstart.htm
@@ -37,7 +37,7 @@
3737
},
3838
fn = V.fn = V.prototype = {
3939
// 版本号
40-
version: "1.3.4",
40+
version: "1.3.5",
4141

4242
constructor: V,
4343

@@ -123,7 +123,8 @@
123123
},
124124
// 刷新:将预处理后的值放回元素的value中
125125
flush: function(value, context){
126-
context.$dom && context.$dom.val(value);
126+
var $dom = context.$dom;
127+
$dom && ($dom.length == 1) && $dom.val(value);
127128
return value;
128129
}
129130
},

0 commit comments

Comments
 (0)