Opened 14 years ago
Closed 14 years ago
#3956 closed bug (invalid)
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.
Change History (6)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Sorry for the bad copy/paste, the good code is :
var data = $("#form :input");
data = data.serializeArray();
comment:3 Changed 14 years ago by
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...
comment:4 Changed 14 years ago by
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?
comment:5 Changed 14 years ago by
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].
comment:6 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Thanks for the follow-up!
Where is data_temp being declared in your example?
data_temp is empty at this point, so is the result from serializeArray().
Replying to ElGigi: