I need to use form inside table cell with fields in another cells. I'm using input form attribute. MVC passing data to controller works correctly but validation before form send doesn't work with this attribute.
<tr>
<td>
@Html.EditorFor(model => item.Code, new { htmlAttributes = new { @class = "form-control inline-edit", form = "editForm" + item.Id } })
@Html.ValidationMessageFor(model => item.Code)
</td>
<td>
@Html.EditorFor(model => item.Name, new { htmlAttributes = new { @class = "form-control inline-edit", form = "editForm" + item.Id } })
@Html.ValidationMessageFor(model => item.Name)
</td>
<td class="text-right">
@using (Html.BeginForm("UpdatePrintMaterial", "Production", FormMethod.Post, new { id = "editForm" + item.Id }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(model => item.Id)
<button class="btn btn-default save" data-toggle="tooltip" title="Zapisz"><i class="fa fa-save"></i></button>
}
</td></tr>
How to workaroud this issue to use validation before sending data?