Required field indicated on inputs?
How are required fields denoted to user on an empty form ? Typically there's a `*` next to the label or input, but looking around the demos I don't see examples
asked 2 months ago
using our demos code ( main, minsetup, both mvc 5 and ASP.net core) in `_FieldLayout.cshtml` you can add the `*` after `RenderBody()`, this will add it after the input ... <div class="einput"> @RenderBody() @(ViewData.ModelMetadata.IsRequired ? "*" : "") </div> if you need it after the label, add it after the call to `@Html.Label` <div class="elabel"> @Html.Label("", ... @(ViewData.ModelMetadata.IsRequired ? "*" : "") </div> so now when you call `@Html.EditorFor` you'll get the `*` for required properties in your viewmodel
answered 2 months ago
to leave an answer