From 3fad4f485dc90101e006c50222f782ac3507742e Mon Sep 17 00:00:00 2001 From: Jan Dolecek Date: Thu, 13 Jan 2011 18:46:39 +0000 Subject: [PATCH] added option for serializing disabled input elements --- src/prototype/dom/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prototype/dom/form.js b/src/prototype/dom/form.js index 8088e9d3d..857908375 100644 --- a/src/prototype/dom/form.js +++ b/src/prototype/dom/form.js @@ -45,7 +45,7 @@ var Form = { * Serialize an array of form elements to an object or string suitable * for [[Ajax]] requests. * - * As per the HTML spec, disabled fields are not included. + * As per the HTML spec, disabled fields are not included (when option includeDisabled is specified, they are included) * * If multiple elements have the same name and we're returning an object, * the value for that key in the object will be an array of the field values @@ -125,7 +125,7 @@ var Form = { } return elements.inject(initial, function(result, element) { - if (!element.disabled && element.name) { + if ((options.includeDisabled || !element.disabled) && element.name) { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) {