I can't really find a good match for this question,
I have this task of getting the values from this elements
Card record 1 :
<input type="text" name="card[][company]" />
<input type="text" name="card[][bank]" />
<input type="text" name="card[][hospital]" />
Card record 2 :
<input type="text" name="card[][company]" />
<input type="text" name="card[][bank]" />
<input type="text" name="card[][hospital]" />
I want to get their values to be like this so I can pass it on to my controller via AJAX (CI)
[0]
card[0][company] = ABC
card[1][bank] = DEF
card[2][hospital] = GHI
[1]
card[0][company] = ABC
card[1][bank] = DEF
card[2][hospital] = GHI
I have tried $.each with .push and .map but can't really figure out the correct manipulation, JQUERY answers please.
serialize()on the form and let jQuery do all the heavy lifting internally?