Permalink
Browse files

added option for serializing disabled input elements

  • Loading branch information...
1 parent ab05721 commit 3fad4f485dc90101e006c50222f782ac3507742e @juzna committed Jan 13, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 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)))) {

0 comments on commit 3fad4f4

Please sign in to comment.