<table>
@{int counter = @ViewBag.counter, j = 0, k = 0; }
<tr>
<td>
@Html.EditorFor(model => model.PortTariffList[counter].StartRate, new { htmlAttributes = new { size = 5, maxLength = 10 } })
|
@Html.EditorFor(model => model.PortTariffList[counter].EndRate, new { htmlAttributes = new { size = 5, maxLength = 10 } })
</td>
@foreach (var tlist in Model.PortTariffList)
{
if (counter == k)
{
foreach (var amount in tlist.list)
{
<td>@Html.EditorFor(model => model.PortTariffList[counter].list[j].Amount, new { htmlAttributes = new { size = 6, maxLength = 10 } }) </td>
@Html.HiddenFor(model => model.PortTariffList[counter].list[j].TerminalId)
@Html.Hidden("PortTariffList.Index", counter)
j++;
}
} k++;
}
<td>
<input type="button" value="Remove" name="Remove" class="RemoveLink small" data-id="@counter" />
</td>
</tr>
</table>
創建動態文本框,但是如何獲取jquery中所有行的開始和結束價值?如何獲得asp.net mvc動態文本框的值爲
嘗試爲每個'textbox'或類似'$('table input [type = text]')。each(function(){$(this).val()});' –
我有每行比較開始和結束率文本框? –