More improvements to registration, leaf input create, and charting
This commit is contained in:
@@ -2,4 +2,22 @@
|
||||
@{
|
||||
Layout = "_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.Password("", ViewData.TemplateInfo.FormattedModelValue, new { @class = "form-control" })
|
||||
@{
|
||||
var htmlAttributes = new RouteValueDictionary();
|
||||
|
||||
var controlClass = "form-control";
|
||||
|
||||
if (ViewBag.@class != null)
|
||||
{
|
||||
controlClass = string.Concat(controlClass, " ", ViewBag.@class);
|
||||
}
|
||||
|
||||
if (ViewData.ModelState.ContainsKey(ViewData.TemplateInfo.HtmlFieldPrefix) &&
|
||||
ViewData.ModelState[ViewData.TemplateInfo.HtmlFieldPrefix].Errors.Any())
|
||||
{
|
||||
controlClass = string.Concat(controlClass, " ", "is-invalid");
|
||||
}
|
||||
htmlAttributes.Add("class", controlClass);
|
||||
}
|
||||
|
||||
@Html.Password("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
|
||||
@@ -6,18 +6,18 @@
|
||||
var prefix = ViewData.TemplateInfo.HtmlFieldPrefix;
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = string.Empty;
|
||||
|
||||
var required = new { required = "true" };
|
||||
var required = " required";
|
||||
|
||||
foreach (var li in Model.ListItems)
|
||||
{
|
||||
var name = prefix + ".Selected";
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="@name" id="@li.Value" value="@li.Value" @(li.Selected ? " checked" : "")>
|
||||
<input class="form-check-input" type="radio" name="@name" id="@li.Value" value="@li.Value" @(li.Selected ? " checked" : "")@required>
|
||||
<label class="form-check-label" for="@li.Value">
|
||||
@li.Text
|
||||
</label>
|
||||
</div>
|
||||
required = null;
|
||||
//required = string.Empty;
|
||||
}
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = prefix;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
@{
|
||||
var propertyName = ViewData.ModelMetadata.PropertyName;
|
||||
//var isChecked = Model.HasValue && Model.Value;
|
||||
}
|
||||
|
||||
<div class="@(Html.ValidationErrorFor(m => m, " is-invalid"))">
|
||||
|
||||
Reference in New Issue
Block a user