Bootstrap FreeKB - MVC - Make an input field required
MVC - Make an input field required

Updated:   |  MVC articles

Add required = "required" to the HTML attributes.

@Html.EditorFor(model => model.article_title, new { htmlAttributes = new { @class = "form-control", required = "required" } })

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter c1f357 in the box below so that we can be sure you are a human.