This won't work:
<input type="text" name="start_time[0][0]" value="00">
<input type="text" name="start_time[0][1]" value="01">
<input type="text" name="start_time[1][0]" value="10">
<input type="text" name="start_time[1][1]" value="11">
$("form[name='fare-form'] input[name='start_time[][]'").click(function() {
console.log($(this).val());
});
If I specify array indices, it'll work. And I'm presuming using 1-dimensional array works which I've used elsewhere.
Why won't it work?
I learnt it has to match exactly. So in the case where I do 1-dimensional array such as:
<input type="text" name="start_time[]" value="1">
<input type="text" name="start_time[]" value="2">
$("form[name='fare-form'] input[name='start_time[]'").click(function() {
console.log($(this).val());
});
This works because Javascript or whatever will automatically create array of two indices but the reference of start_time[] in event will point to both elements of array?