Last active
June 14, 2016 14:55
-
-
Save soen/3edc1c10eda79ae04b4a36d676a76004 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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