I have a requirement in which I\'m implementing sitecore WFFM to create a form. The page has HTML input tags with Placeholder attribute. I have to render the WFFM SingleLine
I used the following code to create a Custom Field. And It works fine :)
internal class CustomType : SingleLineText
{
[VisualProperty("Placeholder", 100)]
[VisualCategory("Appearance")]
public string placeholderText
{
get;
set;
}
protected override void DoRender(System.Web.UI.HtmlTextWriter writer)
{
this.textbox.Attributes.Add("placeholder", this.PlaceholderText );
base.DoRender(writer);
}
}
Then i just created an Field Type Item under /sitecore/system/Modules/Web Forms for Marketers/Settings/Field Types/Custom and entered assembly and class details in the item.
Works like a charm...!!