I’m trying to have some html like this:
<input name="list_item[0][name]" />
<input name="list_item[1][name]" />
<input name="list_item[2][name]" />
When I view the raw source of my document, I see these correctly. But when I do inspect element in chrome or firefox, the numbers are incrementing by one! So I see:
<input name="list_item[1][name]" />
<input name="list_item[2][name]" />
<input name="list_item[3][name]" />
And when I inspect the submitted data, the keys start at 1, not 0 which is causing my code to misbehave:
'list_item' =>
array
1 =>
array
'name' => string 'title 1' (length=7)
2 =>
array
'name' => string 'title 2' (length=7)
3 =>
array
'name' => string '' (length=0)
Why is this happening? O_o
I don’t know what exactly caused that, but seems like it was some js 😉