Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jamesdzhang opened this issue Jul 17, 2017 · 0 comments

Comments

@jamesdzhang
Copy link

jamesdzhang commented Jul 17, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant