Web Forms For Marketters (WFFM) Html input tag with placeholder attribute

前端 未结 3 1359
不思量自难忘°
不思量自难忘° 2021-01-02 19:42

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

3条回答
  •  日久生厌
    2021-01-02 20:37

    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...!!

提交回复
热议问题