From 5ea4a7a39709b685140fac6e329949ab8911fcaf Mon Sep 17 00:00:00 2001 From: Mohammad Dameer Date: Thu, 31 Aug 2017 22:18:45 +0300 Subject: [PATCH] Add placeholder editor form and attribute for applicable fields (#7820) --- .../Drivers/EmailFieldElementDriver.cs | 4 +++- .../Drivers/PasswordFieldElementDriver.cs | 9 +++++--- .../Drivers/TextAreaElementDriver.cs | 4 +++- .../Drivers/TextFieldElementDriver.cs | 4 +++- .../Drivers/UrlFieldElementDriver.cs | 4 +++- .../Elements/EmailField.cs | 2 +- .../Elements/FormElementWithPlaceholder.cs | 10 +++++++++ .../Elements/PasswordField.cs | 2 +- .../Orchard.DynamicForms/Elements/TextArea.cs | 2 +- .../Elements/TextField.cs | 2 +- .../Orchard.DynamicForms/Elements/UrlField.cs | 2 +- .../Forms/PlaceholderForm.cs | 22 +++++++++++++++++++ .../Orchard.DynamicForms.csproj | 2 ++ .../Views/Elements/EmailField.Design.cshtml | 1 + .../Views/Elements/EmailField.cshtml | 1 + .../Elements/PasswordField.Design.cshtml | 1 + .../Views/Elements/PasswordField.cshtml | 1 + .../Views/Elements/TextArea.Design.cshtml | 1 + .../Views/Elements/TextArea.cshtml | 1 + .../Views/Elements/TextField.Design.cshtml | 1 + .../Views/Elements/TextField.cshtml | 1 + .../Views/Elements/UrlField.Design.cshtml | 1 + .../Views/Elements/UrlField.cshtml | 1 + 23 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/FormElementWithPlaceholder.cs create mode 100644 src/Orchard.Web/Modules/Orchard.DynamicForms/Forms/PlaceholderForm.cs diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/EmailFieldElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/EmailFieldElementDriver.cs index 282f08608..af8bb691a 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/EmailFieldElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/EmailFieldElementDriver.cs @@ -16,10 +16,11 @@ namespace Orchard.DynamicForms.Drivers { protected override EditorResult OnBuildEditor(EmailField element, ElementEditorContext context) { var autoLabelEditor = BuildForm(context, "AutoLabel", "Properties:1"); + var placeholderEditor = BuildForm(context, "Placeholder", "Properties:10"); var emailFieldEditor = BuildForm(context, "EmailField", "Properties:15"); var emailFieldValidation = BuildForm(context, "EmailFieldValidation", "Validation:10"); - return Editor(context, autoLabelEditor, emailFieldEditor, emailFieldValidation); + return Editor(context, autoLabelEditor, placeholderEditor, emailFieldEditor, emailFieldValidation); } protected override void DescribeForm(DescribeContext context) { @@ -80,6 +81,7 @@ namespace Orchard.DynamicForms.Drivers { var tokenData = context.GetTokenData(); context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData); context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); + context.ElementShape.ProcessedPlaceholder = _tokenizer.Replace(element.Placeholder, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); // Allow the initial value to be tokenized. // If a value was posted, use that value instead (without tokenizing it). diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/PasswordFieldElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/PasswordFieldElementDriver.cs index ae3f40dec..3d7e5c1c0 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/PasswordFieldElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/PasswordFieldElementDriver.cs @@ -16,9 +16,10 @@ namespace Orchard.DynamicForms.Drivers { protected override EditorResult OnBuildEditor(PasswordField element, ElementEditorContext context) { var autoLabelEditor = BuildForm(context, "AutoLabel", "Properties:1"); + var placeholderEditor = BuildForm(context, "Placeholder", "Properties:10"); var passwordFieldValidation = BuildForm(context, "PasswordFieldValidation", "Validation:10"); - return Editor(context, autoLabelEditor, passwordFieldValidation); + return Editor(context, autoLabelEditor, placeholderEditor, passwordFieldValidation); } protected override void DescribeForm(DescribeContext context) { @@ -74,8 +75,10 @@ namespace Orchard.DynamicForms.Drivers { } protected override void OnDisplaying(PasswordField element, ElementDisplayingContext context) { - context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData()); - context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); + var tokenData = context.GetTokenData(); + context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData); + context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); + context.ElementShape.ProcessedPlaceholder = _tokenizer.Replace(element.Placeholder, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextAreaElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextAreaElementDriver.cs index 7aaa76212..8bf469878 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextAreaElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextAreaElementDriver.cs @@ -15,10 +15,11 @@ namespace Orchard.DynamicForms.Drivers { protected override EditorResult OnBuildEditor(TextArea element, ElementEditorContext context) { var autoLabelEditor = BuildForm(context, "AutoLabel", "Properties:1"); + var placeholderEditor = BuildForm(context, "Placeholder", "Properties:10"); var textAreaEditor = BuildForm(context, "TextArea", "Properties:15"); var textAreaValidation = BuildForm(context, "TextAreaValidation", "Validation:10"); - return Editor(context, autoLabelEditor, textAreaEditor, textAreaValidation); + return Editor(context, autoLabelEditor, placeholderEditor, textAreaEditor, textAreaValidation); } protected override void DescribeForm(DescribeContext context) { @@ -91,6 +92,7 @@ namespace Orchard.DynamicForms.Drivers { var tokenData = context.GetTokenData(); context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData); context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); + context.ElementShape.ProcessedPlaceholder = _tokenizer.Replace(element.Placeholder, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); // Allow the initial value to be tokenized. // If a value was posted, use that value instead (without tokenizing it). diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextFieldElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextFieldElementDriver.cs index 7b1f8fb80..e3bf452eb 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextFieldElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextFieldElementDriver.cs @@ -16,10 +16,11 @@ namespace Orchard.DynamicForms.Drivers { protected override EditorResult OnBuildEditor(TextField element, ElementEditorContext context) { var autoLabelEditor = BuildForm(context, "AutoLabel", "Properties:1"); + var placeholderEditor = BuildForm(context, "Placeholder", "Properties:10"); var textFieldEditor = BuildForm(context, "TextField", "Properties:15"); var textFieldValidation = BuildForm(context, "TextFieldValidation", "Validation:10"); - return Editor(context, autoLabelEditor, textFieldEditor, textFieldValidation); + return Editor(context, autoLabelEditor, placeholderEditor, textFieldEditor, textFieldValidation); } protected override void DescribeForm(DescribeContext context) { @@ -86,6 +87,7 @@ namespace Orchard.DynamicForms.Drivers { var tokenData = context.GetTokenData(); context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData); context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData, new ReplaceOptions {Encoding = ReplaceOptions.NoEncode}); + context.ElementShape.ProcessedPlaceholder = _tokenizer.Replace(element.Placeholder, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); // Allow the initial value to be tokenized. // If a value was posted, use that value instead (without tokenizing it). diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/UrlFieldElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/UrlFieldElementDriver.cs index cec7f583b..9d74f16e9 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/UrlFieldElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/UrlFieldElementDriver.cs @@ -16,10 +16,11 @@ namespace Orchard.DynamicForms.Drivers { protected override EditorResult OnBuildEditor(UrlField element, ElementEditorContext context) { var autoLabelEditor = BuildForm(context, "AutoLabel", "Properties:1"); + var placeholderEditor = BuildForm(context, "Placeholder", "Properties:10"); var webAddressFieldEditor = BuildForm(context, "UrlField", "Properties:15"); var webAddressFieldValidation = BuildForm(context, "UrlFieldValidation", "Validation:10"); - return Editor(context, autoLabelEditor, webAddressFieldEditor, webAddressFieldValidation); + return Editor(context, autoLabelEditor, placeholderEditor, webAddressFieldEditor, webAddressFieldValidation); } protected override void DescribeForm(DescribeContext context) { @@ -74,6 +75,7 @@ namespace Orchard.DynamicForms.Drivers { var tokenData = context.GetTokenData(); context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData); context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); + context.ElementShape.ProcessedPlaceholder = _tokenizer.Replace(element.Placeholder, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }); // Allow the initial value to be tokenized. // If a value was posted, use that value instead (without tokenizing it). diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/EmailField.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/EmailField.cs index 4cf872a22..345e2c553 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/EmailField.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/EmailField.cs @@ -1,7 +1,7 @@ using Orchard.DynamicForms.Validators.Settings; namespace Orchard.DynamicForms.Elements { - public class EmailField : LabeledFormElement { + public class EmailField : FormElementWithPlaceholder { public EmailFieldValidationSettings ValidationSettings { get { return Data.GetModel(""); } } diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/FormElementWithPlaceholder.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/FormElementWithPlaceholder.cs new file mode 100644 index 000000000..2e04d8363 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/FormElementWithPlaceholder.cs @@ -0,0 +1,10 @@ +using Orchard.Layouts.Helpers; + +namespace Orchard.DynamicForms.Elements { + public abstract class FormElementWithPlaceholder : LabeledFormElement { + public string Placeholder { + get { return this.Retrieve(x => x.Placeholder); } + set { this.Store(x => x.Placeholder, value); } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/PasswordField.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/PasswordField.cs index 8625646f3..13f364412 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/PasswordField.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/PasswordField.cs @@ -1,7 +1,7 @@ using Orchard.DynamicForms.Validators.Settings; namespace Orchard.DynamicForms.Elements { - public class PasswordField : LabeledFormElement { + public class PasswordField : FormElementWithPlaceholder { public PasswordFieldValidationSettings ValidationSettings { get { return Data.GetModel(""); } } diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextArea.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextArea.cs index f4e232dc6..f5b6e5ee1 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextArea.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextArea.cs @@ -2,7 +2,7 @@ using Orchard.Layouts.Helpers; namespace Orchard.DynamicForms.Elements { - public class TextArea : LabeledFormElement { + public class TextArea : FormElementWithPlaceholder { public int? Rows { get { return this.Retrieve(x => x.Rows); } set { this.Store(x => x.Rows, value); } diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextField.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextField.cs index ca8b170ef..ec9476832 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextField.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/TextField.cs @@ -1,7 +1,7 @@ using Orchard.DynamicForms.Validators.Settings; namespace Orchard.DynamicForms.Elements { - public class TextField : LabeledFormElement { + public class TextField : FormElementWithPlaceholder { public TextFieldValidationSettings ValidationSettings { get { return Data.GetModel(""); } } diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/UrlField.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/UrlField.cs index 83e24971d..c0fba8196 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/UrlField.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Elements/UrlField.cs @@ -1,7 +1,7 @@ using Orchard.DynamicForms.Validators.Settings; namespace Orchard.DynamicForms.Elements { - public class UrlField : LabeledFormElement { + public class UrlField : FormElementWithPlaceholder { public UrlFieldValidationSettings ValidationSettings { get { return Data.GetModel(""); } } diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Forms/PlaceholderForm.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Forms/PlaceholderForm.cs new file mode 100644 index 000000000..95386e0a0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Forms/PlaceholderForm.cs @@ -0,0 +1,22 @@ +using Orchard.Forms.Services; +using DescribeContext = Orchard.Forms.Services.DescribeContext; + +namespace Orchard.DynamicForms.Forms { + public class PlaceholderForm : Component, IFormProvider { + public void Describe(DescribeContext context) { + context.Form("Placeholder", factory => { + var shape = (dynamic)factory; + var form = shape.Fieldset( + Id: "Placeholder", + _Placeholder: shape.Textbox( + Id: "Placeholder", + Name: "Placeholder", + Title: "Placeholder", + Classes: new[] { "text", "large", "tokenized" }, + Description: T("The text to render as placeholder."))); + + return form; + }); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj b/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj index 2e524af77..c56fd5218 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj @@ -127,6 +127,8 @@ + + diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.Design.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.Design.cshtml index f16f885b1..6b8fcbe45 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.Design.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.Design.cshtml @@ -8,6 +8,7 @@ tagBuilder.Attributes["type"] = "text"; tagBuilder.Attributes["value"] = element.Value; tagBuilder.Attributes["name"] = element.Name; + tagBuilder.Attributes["placeholder"] = element.Placeholder; } @if (element.ShowLabel) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.cshtml index e43fca7d5..b623177e8 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/EmailField.cshtml @@ -9,6 +9,7 @@ tagBuilder.Attributes["type"] = "email"; tagBuilder.Attributes["value"] = Model.ProcessedValue; tagBuilder.Attributes["name"] = Model.ProcessedName; + tagBuilder.Attributes["placeholder"] = Model.ProcessedPlaceholder; tagBuilder.AddClientValidationAttributes((IDictionary)Model.ClientValidationAttributes); if (!ViewData.ModelState.IsValidField(Model.ProcessedName)) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.Design.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.Design.cshtml index 4b237e0e7..bf0d9e8d6 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.Design.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.Design.cshtml @@ -8,6 +8,7 @@ tagBuilder.Attributes["type"] = "password"; tagBuilder.Attributes["value"] = element.Value; tagBuilder.Attributes["name"] = element.Name; + tagBuilder.Attributes["placeholder"] = element.Placeholder; } @if (element.ShowLabel) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.cshtml index 7e03762ea..5edf8bf27 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/PasswordField.cshtml @@ -8,6 +8,7 @@ tagBuilder.AddCssClass("text"); tagBuilder.Attributes["type"] = "password"; tagBuilder.Attributes["name"] = Model.ProcessedName; + tagBuilder.Attributes["placeholder"] = Model.ProcessedPlaceholder; tagBuilder.AddClientValidationAttributes((IDictionary)Model.ClientValidationAttributes); if (!ViewData.ModelState.IsValidField(element.Name)) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.Design.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.Design.cshtml index 5481c36d8..53f13581c 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.Design.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.Design.cshtml @@ -6,6 +6,7 @@ tagBuilder.AddCssClass("text design"); tagBuilder.Attributes["name"] = element.Name; + tagBuilder.Attributes["placeholder"] = element.Placeholder; if (element.Rows != null) { tagBuilder.Attributes["rows"] = element.Rows.ToString(); diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.cshtml index af64c27d5..6c48653ae 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextArea.cshtml @@ -8,6 +8,7 @@ tagBuilder.AddCssClass("text"); tagBuilder.Attributes["name"] = name; + tagBuilder.Attributes["placeholder"] = Model.ProcessedPlaceholder; tagBuilder.AddClientValidationAttributes((IDictionary)Model.ClientValidationAttributes); if (element.Rows != null) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.Design.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.Design.cshtml index 1d266252d..7bb3df4b4 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.Design.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.Design.cshtml @@ -8,6 +8,7 @@ tagBuilder.Attributes["type"] = "text"; tagBuilder.Attributes["value"] = element.Value; tagBuilder.Attributes["name"] = element.Name; + tagBuilder.Attributes["placeholder"] = element.Placeholder; } @if (element.ShowLabel) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.cshtml index f0cc0579e..706ef654d 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/TextField.cshtml @@ -9,6 +9,7 @@ tagBuilder.Attributes["type"] = "text"; tagBuilder.Attributes["value"] = Model.ProcessedValue; tagBuilder.Attributes["name"] = Model.ProcessedName; + tagBuilder.Attributes["placeholder"] = Model.ProcessedPlaceholder; tagBuilder.AddClientValidationAttributes((IDictionary)Model.ClientValidationAttributes); if (!ViewData.ModelState.IsValidField(Model.ProcessedName)) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.Design.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.Design.cshtml index aad86e6c3..33bb8123a 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.Design.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.Design.cshtml @@ -8,6 +8,7 @@ tagBuilder.Attributes["type"] = "url"; tagBuilder.Attributes["value"] = element.Value; tagBuilder.Attributes["name"] = element.Name; + tagBuilder.Attributes["placeholder"] = element.Placeholder; } @if (element.ShowLabel) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.cshtml b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.cshtml index a205053dc..5fab6d6e1 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.cshtml +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Views/Elements/UrlField.cshtml @@ -9,6 +9,7 @@ tagBuilder.Attributes["type"] = "url"; tagBuilder.Attributes["value"] = Model.ProcessedValue; tagBuilder.Attributes["name"] = Model.ProcessedName; + tagBuilder.Attributes["placeholder"] = Model.ProcessedPlaceholder; tagBuilder.AddClientValidationAttributes((IDictionary)Model.ClientValidationAttributes); if (!ViewData.ModelState.IsValidField(Model.ProcessedName)) {