see below the following code:
<input type="text" id="task" name="task[]" value="100" />
<input type="text" id="task" name="task[]" value="110" />
<input type="text" id="task" name="task[]" value="120" />
And in jquery, I read the array normally:
$(function(){
var values = $("input[name='task\[\]']")
.map(function(){return $(this).val();}).get();
alert(values);
});
Now, when you include the manual index in the array, it looks like this:
<input type="text" id="task" name="task[1]" value="100" />
<input type="text" id="task" name="task[2]" value="110" />
<input type="text" id="task" name="task[3]" value="120" />
In this case, jquery no longer reads the array. What should be done to make reading possible?