Skip to content

Instantly share code, notes, and snippets.

@JRondeau16
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JRondeau16/5e6ad252ef3da960a9e5 to your computer and use it in GitHub Desktop.
Save JRondeau16/5e6ad252ef3da960a9e5 to your computer and use it in GitHub Desktop.
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