Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using Sitecore.Data.Items;
using Sitecore.Forms.Mvc.Attributes;
using Sitecore.Forms.Mvc.Controllers.ModelBinders.FieldBinders;
using Sitecore.Forms.Mvc.Models.Fields;
using Sitecore.Forms.Mvc.Validators;
namespace MyProject.Integration.Wfm
{
public class TermsAgreementField : CheckBoxField
{
public string TermsLabel { get; set; }
[DynamicRequired("IsRequired", ErrorMessage = "The {0} field is required.")]
[PropertyBinder(typeof(CheckboxFieldValueBinder))]
public override object Value { get; set; }
public override bool IsRequired
{
get { return true; }
}
public TermsAgreementField(Item item) : base(item) {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment