i have written this code in one of the view using ASP.NET MVC. MVC returns me the checkboxes values (only those are checked) and with textboxes it returns me all (0,1,2 etc). how can i co-relate which textbox value belongs to which checkbox (since only i get the checked checkbox values)
For Each item As InternalMailCalendarViewModel In ViewData("InternalMailCalendar")
End Code
<div class="editor-field">
@Html.CheckBox("InternalMailCalendarID", New With {.value = item.ID})
<label for="@item.ID">@item.Days</label>
</div>
<div class="editor-field">
<input type="text" id="RunsPerDay" name="RunsPerDay" placeholder="Runs Per Day" />
@Html.ValidationMessageFor(Function(model) model.RunsPerDay)
</div>
@*
<div class="editor-field">
<input type="checkbox" id="InternalMailCalendarID" name="InternalMailCalendarID" value="@item.ID" />
<label for="@item.ID">@item.Days</label>
</div>
<div class="editor-field">
<input type="text" id="RunsPerDay" name="RunsPerDay" placeholder="Runs Per Day" />
@Html.ValidationMessageFor(Function(model) model.RunsPerDay)
</div>
*@
@Code
Next
End Code