Answer the question
In order to leave comments, you need to log in
How to properly validate on the client in an ASP.NET table row?
I made a page in ASP.NET CORE with editing directly in table:
In model, this field is annotated like this [RegularExpression(@"^[1-9]+[0-9]*[\.,]{0,1}[0- 9]{0,2}",ErrorMessage ="Invalid number format")].
In the view, respectively:
<td>
<h4>
<input asp-for="@item.RateString" />
</h4>
<span asp-validation-for="@item.RateString" class="text-danger" style="margin-left:32px"></span>
</td>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question