Bug Tracker

Opened 8 years ago

Closed 6 years ago

#2871 closed enhancement (fixed)

Multi dimentional array support for ajax posting.

Reported by: the7erm Owned by:
Priority: major Milestone: 1.2.4
Component: ajax Version: 1.2.3
Keywords: Cc:
Blocked by: Blocking:


I don't know if you want to add this or not, but it's there if you want it.

I do a lot of multi dimensional work, and figured it'd be nice to have this ability in jquery.


Change History (3)

comment:1 Changed 8 years ago by flesler

Hi the7erm

We rejected a similar feature, although we had all ready to commit, because of a cite on a spec on webforms.

Check #2726. I'll close this soon, reply if you have something to add.

comment:2 Changed 8 years ago by ygirouard

I'm not sure if this works with server-side languages other than php, but if you pass key/value pairs where the key has a [something] appended to its name, php will convert it into an array where "something" becomes an index.

So, if you want to pass a multi-dimensional array when posting, you could do something like this:

Let's say you want to pass something like this:

var options = {
 "b":{"I":"1", "II":"2"},

So that you receive this on server-side (in php in my case):


You could pass this in your post:

var options = {

It may need a bit of manual parsing in javascript if you had a pre-constructed object you want to pass, but that's easy enough to do using the "for (key in object) {}" method...


var options = {
 "b":{"I":"1", "II":"2"},

var b = options.b;
for (i in b) {
 options["b[" + i + "]"] = b[i];

comment:3 Changed 6 years ago by dmethvin

  • Resolution set to fixed
  • Status changed from new to closed

Implemented via the ajax traditional property.

Note: See TracTickets for help on using tickets.