[KSS-checkins] r45101 - kukit/kukit.js/trunk/kukit
jvloothuis at codespeak.net
jvloothuis at codespeak.net
Sun Jul 15 13:28:10 CEST 2007
Author: jvloothuis
Date: Sun Jul 15 13:28:09 2007
New Revision: 45101
Modified:
kukit/kukit.js/trunk/kukit/forms.js
Log:
Added an extra check to the form encoding function. This will make
sure that array values are properly repeated in the post request. By
doing this we fix an issue with multi selection fields.
Modified: kukit/kukit.js/trunk/kukit/forms.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/forms.js (original)
+++ kukit/kukit.js/trunk/kukit/forms.js Sun Jul 15 13:28:09 2007
@@ -50,7 +50,13 @@
};
kukit.fo.FormQuery.prototype.appendElem = function(name, value) {
- if (typeof(value) == 'object') {
+ if (typeof(value) == 'object' && value.constructor.toString().indexOf('Array')!=-1){
+ for(var i=0; i<value.length; i++){
+ var elem = new kukit.fo.FormQueryElem(name, value[i]);
+ this.l.push(elem);
+ }
+ }
+ else if (typeof(value) == 'object') {
// Special marshalling of dicts
for (var key in value) {
var qkey = kukit.fo.dictprefix + name + kukit.fo.dictseparator + key + kukit.fo.dictpostfix;
More information about the Kukit-checkins
mailing list