Skip to content

Instantly share code, notes, and snippets.

@TimGeyssens
Created May 20, 2015 13:23
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 TimGeyssens/38bd409d4c8c288e6555 to your computer and use it in GitHub Desktop.
Save TimGeyssens/38bd409d4c8c288e6555 to your computer and use it in GitHub Desktop.
public class Textfield : FieldType
{
[Attributes.Setting("DefaultValue",
description = "Enter a default value")]
public string DefaultValue { get; set; }
public Textfield() {
//Provider
this.Id = new Guid("3F92E01B-29E2-4a30-BF33-9DF5580ED52C");
this.Name = "Textfield";
this.Description = "Renders a html input fieldKey";
//FieldType
this.Icon = "icon-autofill";
this.DataType = FieldDataType.String;
this.Category = "Simple";
this.SortOrder = 10;
}
public override bool SupportsRegex
{
get
{
return true;
}
}
}
@ivansuharyadi
Copy link

Hi @tim

It possible to create extra settings field is mandatory ?

[Umbraco.Forms.Core.Attributes.Setting("Policy", prevalues = "", description = "Enter the policy to show in the checkbox", view = "TextField")]
public string Policy { get; set; }

Regards,
Ivan S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment