!136 optgroup标签下多选后表单值转json丢失
Merge pull request !136 from Dulk/fix-optgroup_value_jsonOverride_bug
This commit is contained in:
commit
ac97d15a7f
@ -1353,7 +1353,11 @@
|
|||||||
formToJSON: function(formId) {
|
formToJSON: function(formId) {
|
||||||
var json = {};
|
var json = {};
|
||||||
$.each($("#" + formId).serializeArray(), function(i, field) {
|
$.each($("#" + formId).serializeArray(), function(i, field) {
|
||||||
|
if(json[field.name]) {
|
||||||
|
json[field.name] += ("," + field.value);
|
||||||
|
} else {
|
||||||
json[field.name] = field.value;
|
json[field.name] = field.value;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user