If you are using the MVC version of WFFM, you need to add the following as described in the approved answer
1- Create a class
public interface IPlaceholderField { string PlaceHolder { get; set; } } [ValidationProperty("Text")] public class SingleLineText : Sitecore.Form.Web.UI.Controls.SingleLineText, IPlaceholderField { [VisualCategory("Custom Properties")] [VisualProperty("Placeholder", 2)] [DefaultValue("")] public string PlaceHolder { get; set; } protected override void OnInit(EventArgs e) {
2- Copy single-line text from / sitecore / system / Modules / Web Forms for Marketers / Settings / Field Types / Simple types / Single-line text to / sitecore / system / Modules / Web forms for marketers / Settings / Field types / Custom set Assembly , Class and MVC Type

3-Create a new chtml file under \ Views \ Form \ EditorTemplates ane its name is ExtendedSingleLineTextField.cshtml, it should be with the class name ( ExtendedSingleLineTextField )
@using Sitecore.Forms.Mvc.Html @using LendLease.Web.HtmlHelpers @model LendLease.Extension.Sc.WFFM.ExtendedSingleLineTextField @using (Html.BeginField()) { @*@Html.TextBoxFor(m => m.Value, new { placeholder = Model.PlaceHolder })*@ @Html.ExtendedBootstrapEditor("value",Model.PlaceHolder,"",new []{""}) }
add html helper so you can embed placeholder i named it BootstrapEditorHtmlHelperExtension.cs
public static class BootstrapEditorHtmlHelperExtension { public static MvcHtmlString ExtendedBootstrapEditor(this HtmlHelper helper, string expression, string placeholderText, string inlineStyle, string[] classes) { var str = string.Empty; var viewModel = helper.ViewData.Model as IViewModel; if (viewModel != null) { var styleSettings = viewModel as IStyleSettings; if (styleSettings != null) { str = styleSettings.CssClass; } if (string.IsNullOrEmpty(placeholderText)) { placeholderText = viewModel.Title; } } return helper.Editor(expression, new { htmlAttributes = new { @class = (string.Join(" ", classes) + " form-control" + (string.IsNullOrEmpty(str) ? string.Empty : " " + str) + (helper.ViewData.Model is SingleLineTextField ? " dangerousSymbolsCheck" : string.Empty)), placeholder = placeholderText, style = (inlineStyle ?? string.Empty) } }); } }
source share