!136 optgroup标签下多选后表单值转json丢失

Merge pull request !136 from Dulk/fix-optgroup_value_jsonOverride_bug
pull/136/MERGE
若依 2019-09-30 12:56:03 +08:00 committed by Gitee
commit ac97d15a7f
1 changed files with 5 additions and 1 deletions

View File

@ -1353,7 +1353,11 @@
formToJSON: function(formId) {
var json = {};
$.each($("#" + formId).serializeArray(), function(i, field) {
if(json[field.name]) {
json[field.name] += ("," + field.value);
} else {
json[field.name] = field.value;
}
});
return json;
}