0
Follows code:
View:
<div class="form-group">
@Html.LabelFor(m => m.Telefone, new { @class = "font-weight-bold" })
@Html.TextBoxFor(m => m.Telefone, new { @class = "form-control", @placeholder = "Digite seu telefone" })
@Html.ValidationMessageFor(m => m.Telefone, "", new { @class = "text-danger" })
</div>
Here is an example of bootstrap v4: https://getbootstrap.com/docs/4.0/components/forms/#server-side
They use the class is-invalid
and is-valid
. How do I do it in Razor ?
you want to do this so that after the post, when returning with the validation apply the class or you refer to mark as valid in real time via javascript?
– Leandro Angelo
I want to do it with Client-Side. (real time via javascript)
– Matheus Miranda