Ticket #4408: form-getValues-fix.diff
| File form-getValues-fix.diff, 1.0 kB (added by guest, 15 months ago) |
|---|
-
form/Form.js
160 175 161 176 // get widget values 162 177 var obj = {}; 178 var usedIds = {}; 163 179 dojo.forEach(this.getDescendants(), function(widget){ 164 180 var value = widget.getValue ? widget.getValue() : widget.value; 165 181 var name = widget.name; 166 182 if(!name){ return; } 167 183 184 usedIds[widget.domNode.id] = true; 168 185 // Store widget's value(s) as a scalar, except for checkboxes which are automatically arrays 169 186 if(widget.setChecked){ 170 187 if(/Radio/.test(widget.declaredClass)){ … … 189 206 } 190 207 }); 191 208 209 dojo.forEach(this.containerNode.elements, function(elm) { 210 if (!elm.name || usedIds[elm.id]===true) { 211 return; // like "continue" 212 } 213 obj[elm.name] = elm.value; 214 }); 215 192 216 /*** 193 217 * code for plain input boxes (see also dojo.formToObject, can we use that instead of this code? 194 218 * but it doesn't understand [] notation, presumably)