比如,有这样一个需求,一个人可以添加多条实习经历,我在页面可以点击一个按钮来添加多个实习经历的form,这个表单的内容是一样的,class也是一样,每个表单转成的json格式就是{Id: "1",name: "xsx",content:"this is a example"},这个我是获取到了。多个相同表单(input name值相同)的格式要求是:[ {Id: "1",name: "xsx",content:"this is a example"}, {Id: "1",name: "xsx",content:"this is a example"},{Id: "1",name: "xsx",content:"this is a example"},... ]现在的问题是我用遍历的方法把每个表单push进一个数组里面,但出来的是{Id: ["1","2","3"],name: ["xsx","sdw","www"],content:["this is a example1","this is a example2","this is a example3"]}这种形式,完全不对啊。这是我遍历的函数:求助!
添加回答
举报
0/150
提交
取消
