I need to add some custom html attributes to WFFM submit button.
I know that it is possible to create custom field type for WFFM it is quite easy to do... but it is no way to do it for submit. basically it is located in Sitecore.Form.Web.UI.Controls.FormSubmit namespace at Sitecore.Forms.Core lib.
in WFFM form configuration files it is noting about it. Any ideas how to do it ?
it seems like should be override
// Sitecore.Forms.Mvc.Html.HtmlHelperExtensions
public static MvcHtmlString BootstrapSubmit(this HtmlHelper helper, string title = null)
{
TagBuilder tagBuilder = new TagBuilder("input");
tagBuilder.Attributes.Add("type", "submit");
ISubmitSettings submitSettings = helper.ViewData.Model as ISubmitSettings;
string value = string.Empty;
string value2 = string.Empty;
string text = string.Empty;
string str = string.Empty;
if (submitSettings != null)
{
value = submitSettings.SubmitButtonSize;
value2 = submitSettings.SubmitButtonType;
text = submitSettings.SubmitButtonName;
str = submitSettings.SubmitButtonPosition;
}
tagBuilder.Attributes.Add("value", title ?? text);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("btn").Append(" ").Append(value).Append(" ").Append(value2);
IStyleSettings styleSettings = helper.ViewData.Model as IStyleSettings;
if (styleSettings != null && styleSettings.FormType != FormType.Inline)
{
TagBuilder tagBuilder2 = new TagBuilder("div");
tagBuilder2.AddCssClass(("form-submit-border " + str).Trim());
tagBuilder.AddCssClass(stringBuilder.ToString().Trim());
TagBuilder expr_10F = tagBuilder2;
expr_10F.InnerHtml += tagBuilder;
return MvcHtmlString.Create(tagBuilder2.ToString());
}
tagBuilder.AddCssClass(stringBuilder.ToString().Trim());
return MvcHtmlString.Create(tagBuilder.ToString());
}