Fixed handling of json requests using etemplate.process_exec and fixes in the json encoding of hierarchical values

This commit is contained in:
Andreas Stöckel
2010-06-10 10:33:00 +00:00
parent d4549782e5
commit bd023081e6
2 changed files with 12 additions and 8 deletions

View File

@@ -320,10 +320,11 @@ function _egw_json_getFormValue(serialized, child)
}
var name = child.name;
var values = new Array;
var values = null;
if ('select-multiple' == child.type)
{
values = new Array;
for (var j = 0; j < child.length; ++j)
{
var option = child.options[j];
@@ -344,7 +345,7 @@ function _egw_json_getFormValue(serialized, child)
var k = n.substr(0, n.indexOf('['));
var a = n.substr(n.indexOf('['));
if (typeof serialized[k] == 'undefined')
serialized[k] = [];
serialized[k] = new Object;
var p = serialized; // pointer reset
while (a.length != 0) {
var sa = a.substr(0, a.indexOf(']')+1);
@@ -364,7 +365,7 @@ function _egw_json_getFormValue(serialized, child)
}
}
if (typeof p[k] == 'undefined')
p[k] = [];
p[k] = new Object;
}
p[k] = values;
} else {