<td></td>
<td>$<input type="text" class="amount" id="inc_rent_0" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_1" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_2" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_3" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_4" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_5" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_6" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_7" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_8" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_9" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_10" value=0 /></td>
<td>$<input type="text" class="amount" id="inc_rent_11" value=0 /></td>
</tr>
$(document).ready(function () {
$("form").submit(function(event) {
event.preventDefault();
var rent_array = [];
var months = 12;
for ( var i = 0 ; i < months ; i++)
{
var value = $("#inc_rent_" + 1).val();
rent_array.push(value);
}
alert(rent_array);
});
});
The Alert shows me the value I input in "inc_rent_1" and repeats it 12 times. So If in the form I enter 1300, 1200, 900 etc etc, the alert(rent_array) prints out 1200, 12 times.