dxq613 / bui

基于jQuery,兼容KISSY 的富客户端控件库

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUI.FormHelper.serializeToObject 序列化已reset过的radio buttons值时取了上一次提交的缓存

jamesdzhang opened this issue · comments

bui版本:不详(不过已检查了压缩过的逻辑和提交本issue时看到最新util.js这块逻辑是一致的,即为:)
serializeToObject:function(form){ var array = $(form).serializeArray(), result = {}; BUI.each(array,function(item){ var name = item.name; if(!result[name]){ //如果是单个值,直接赋值 result[name] = item.value; }else{ //多值使用数组 if(!BUI.isArray(result[name])){ result[name] = [result[name]]; } result[name].push(item.value); } }); return result; },
重现步骤:
1.随便选择一个radio button项并提交相应表单
2. reset该表单中的radio button组
3.提交该表单即可看到radiobutton组页面
上已经重置(无任何选中),但是提交参数中却序列化进去上一次提交选中的选项。

_20170717162440