Skip to content

Instantly share code, notes, and snippets.

@BillCacy
Created July 31, 2020 05:52
Show Gist options
  • Save BillCacy/db98a53b33ab480aafc7331edc76a2a6 to your computer and use it in GitHub Desktop.
Save BillCacy/db98a53b33ab480aafc7331edc76a2a6 to your computer and use it in GitHub Desktop.
Sitecore 9 Forms Encrypted text field view
@using Sitecore.ExperienceForms.Mvc.Html
@model Sample.Feature.Forms.ViewModels.StringInputEncryptedViewModel
<label for="@Html.IdFor(m => Model.Value)" class="@Model.LabelCssClass">@Html.DisplayTextFor(t => Model.Title)</label>
<input id="@Html.IdFor(m => Model.Value)" name="@Html.NameFor(m => Model.Value)" class="@Model.CssClass" type="text" value="@Model.Value" @if (Model.MaxLength > 0) { <text> maxlength="@Model.MaxLength" </text> } placeholder="@Model.PlaceholderText" data-sc-tracking="@Model.IsTrackingEnabled" data-sc-field-name="@Model.Name" data-sc-field-key="@Model.ConditionSettings.FieldKey" @Html.GenerateUnobtrusiveValidationAttributes(m => m.Value) />
@Html.ValidationMessageFor(m => Model.Value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment