Skip to content

Instantly share code, notes, and snippets.

@soen
Last active June 14, 2016 14:55
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 soen/3edc1c10eda79ae04b4a36d676a76004 to your computer and use it in GitHub Desktop.
Save soen/3edc1c10eda79ae04b4a36d676a76004 to your computer and use it in GitHub Desktop.
using Sitecore.Form.Core.Attributes;
using System;
using System.ComponentModel;
using System.Web.UI;
namespace CustomWFFM.CustomFieldTypes
{
[ValidationProperty("Text")]
public class SingleLineTextWithPlaceholderField : Sitecore.Form.Web.UI.Controls.SingleLineText
{
[VisualCategory("Custom Properties")]
[VisualProperty("Placeholder Text", 2)]
[DefaultValue("")]
public string PlaceholderText { get; set; }
protected override void OnInit(EventArgs e)
{
if (!string.IsNullOrEmpty(PlaceholderText))
{
textbox.Attributes["placeholder"] = PlaceholderText;
}
base.OnInit(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment