Skip to main content

Bug Tracker

Side navigation

#3956 closed bug (invalid)

Opened January 22, 2009 03:23PM UTC

Closed February 03, 2009 02:58AM UTC

serializeArray() return a empty array

Reported by: ElGigi Owned by:
Priority: major Milestone: 1.3.2
Component: ajax Version: 1.3.1
Keywords: Cc:
Blocked by: Blocking:
Description

In little form serializeArray() work.

But when tu form is big, serializeArray() return a empty array.

var data = $("#form :input");

data = data_temp.serializeArray();

First line, inputs are here well.

Second line, the array returned is empty.

Attachments (0)
Change History (6)

Changed January 22, 2009 03:34PM UTC by pbcomm comment:1

Where is data_temp being declared in your example?

data_temp is empty at this point, so is the result from serializeArray().

Replying to [ticket:3956 ElGigi]:

In little form serializeArray() work. But when tu form is big, serializeArray() return a empty array. var data = $("#form :input"); data = data_temp.serializeArray(); First line, inputs are here well. Second line, the array returned is empty.

Changed January 23, 2009 09:27AM UTC by ElGigi comment:2

Sorry for the bad copy/paste, the good code is :

var data = $("#form :input");

data = data.serializeArray();

Changed January 23, 2009 10:08AM UTC by ElGigi comment:3

I try to find the origin of the bug.

It's the filter part of the serializeArray function :

.filter(function(){

return this.name && !this.disabled &&

(this.checked || /select|textarea/i.test(this.nodeName) ||

/text|hidden|password/i.test(this.type));

})

If i take off "!this.disabled", it's work well.

But it's appear that the filter part of serializeArray function is the same than 1.2.6.

But filter function has changed...

Changed January 30, 2009 02:33AM UTC by dmethvin comment:4

Does this happen in all browsers, or just one particular browser? Also, how big does the form need to be before the problem appears? Can you attach an example of a large form that doesn't work?

Changed February 02, 2009 01:53PM UTC by ElGigi comment:5

Ok, you can close the bug ;).

My problem was :

Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the '@' symbol from your selectors in order to make them work again.

All inputs were disabled with the selector [@attr] and so jQuery 1.3 return 0 inputs.

Sorry for the wrong alert.

But i suggest to return 0 element when the selector is [@attr].

Changed February 03, 2009 02:58AM UTC by dmethvin comment:6

resolution: → invalid
status: newclosed

Thanks for the follow-up!