From ae84fff8a2ead83c929e9211a0700eeae3ee0e4f Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 23 May 2011 17:23:50 +0200 Subject: [PATCH] [#419] Fixing broken multi-select serialization in prototype 1.7 See https://prototype.lighthouseapp.com/projects/8886/tickets/1180 for details. Contributed by Ben Gunter. --- public/javascripts/prototype.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/javascripts/prototype.js b/public/javascripts/prototype.js index 04a47793..ba12e075 100644 --- a/public/javascripts/prototype.js +++ b/public/javascripts/prototype.js @@ -4992,7 +4992,13 @@ var Form = { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { - result = accumulator(result, key, value); + if (Object.isArray(value)){ + value.each(function(value) { + result = accumulator(result, key, value); + }); + } else { + result = accumulator(result, key, value); + } } } return result;