Skip to content

Commit

Permalink
added option for serializing disabled input elements
Browse files Browse the repository at this point in the history
  • Loading branch information
juzna committed Jan 13, 2011
1 parent ab05721 commit 3fad4f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/prototype/dom/form.js
Expand Up @@ -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
Expand Down Expand Up @@ -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)))) {
Expand Down

0 comments on commit 3fad4f4

Please sign in to comment.