So I have a table that works like this: https://gfycat.com/WeakBlueIslandwhistler
Generated by:
<table class="table table-bordered table-with-button table-condensed " id="hidTable">
<thead>
<tr>
<th>HID #</th>
<th>Lines</th>
</tr>
</thead>
@for (int j = 0; j < 3; j++)
{
<tr>
<td>
<input class="form-control table-with-button" type="number" placeholder="HID" id="hid-@j">
</td>
<td>
<input class="form-control table-with-button" type="number" placeholder="Lines" id="lines-@j">
</td>
</tr>
}
</table>
New rows and textboxes are created by calling a javascript method.
Essentially, there are an unknown number of pairs of text fields in this table, and the data pairs need to be passed to the controller... (I'm thinking storing it as an object in tempdata?)
Each textbox has a unique id (hid-1, hid-2 hid-3 and lines-1, lines-2, lines-3 respectively)
What is the best way to iterate over these textboxes, save their value (I can handle validation prior to saving) and then pass it to the backend?