Skip to main content

Bug Tracker

Side navigation

#12264 closed feature (wontfix)

Opened August 11, 2012 11:08AM UTC

Closed October 29, 2012 05:28PM UTC

Allow users customize the return obj in the serializeArray

Reported by: Owned by:
Priority: low Milestone: None
Component: ajax Version: 1.8.0
Keywords: 1.9-discuss Cc:
Blocked by: Blocking:

I propose to accept a callback function in the serializeArray, so that the users can customize or filter the returning object.

For example:

  return {, value:val, type:elem.type};

This produces the following data structure:

[{label: "a", value: "1", type: "text"},
 {label: "b", value: "2", type: "text"},
 {label: "c", value: "3", type: "hidden"},

Or more powerful one:

  var $elem = jQuery(elem);
    return null;
  else if($':date')){
    return {, value: mySpecialDateFormat(val)};
  else if($':hidden')){
    mySpecialMethodToHandleHiddenInput(, val);
  return {, value:val};
Attachments (0)
Change History (9)

Changed August 11, 2012 11:18AM UTC by comment:1

Changed August 13, 2012 03:40PM UTC by timmywil comment:2

component: unfiledajax
keywords: → 1.9-discuss
priority: undecidedlow
status: newopen
version: → 1.8.0

Changed September 09, 2012 01:10AM UTC by dmethvin comment:3

type: enhancementfeature

Bulk change from enhancement to feature.

Changed September 27, 2012 01:26PM UTC by gibson042 comment:4

-1, this seems much better suited to a plugin.

Changed October 14, 2012 10:37PM UTC by mikesherov comment:5


Changed October 14, 2012 11:44PM UTC by rwaldron comment:6

-1, Monkey patch it

Changed October 22, 2012 05:19PM UTC by gibson042 comment:7


Changed October 22, 2012 05:44PM UTC by gnarf comment:8


 .find( ":input" ).map(...) 

Changed October 29, 2012 05:28PM UTC by mikesherov comment:9

resolution: → wontfix
status: openclosed