user1279563
user1279563

Reputation: 77

jQuery send multidimensional input ajax

I have the following html structure.

<form id="inner" name="dummy">
    ...
        <input type="text" name="set[0][0][xy]" />
        <input type="text" name="set[0][1]" />
        <input type="text" name="set[1][axy]" />
        <input type="text" name="set[2][asxy]" />
        <input type="text" name="set[2][1][xdsay]" />
        <input type="text" name="set[2][2][xasdy]" />
    ...
</form>

I need to send the fields only with name="set[....]" by ajax. And the depth of the multidimensional array is changing.

Any idea?

Upvotes: 0

Views: 116

Answers (1)

Musa
Musa

Reputation: 97672

first of all your markup is invalid you can't have a form in another form, the browser's parser will sort that out.
Your problem is that you selector is wrong, there if no form with name inner, the form has an id inner, so your selector will be form[id="inner"] or form#inner or #inner

Upvotes: 3

Related Questions