0

Is there a possibility to disable the autocomplete of Sitecore WFFM text box. We are using Sitecore 8.1

  • You mean Autofill? from browser cache? – Ahmed Okour Oct 2 '18 at 16:55
  • This is regarding Autofill – PVM Oct 3 '18 at 10:07
1

You may need to create custom SingleLineText field for this:

[ValidationProperty("Text")]
public class SingleLineText : Sitecore.Form.Web.UI.Controls.SingleLineText
{
    [VisualCategory("Custom Properties")]
    [VisualProperty("Autofill", 2)]
    [DefaultValue("off")]
    public string Autofill { get; set; }

    protected override void OnInit(EventArgs e)
    {
        // Set placeholder text, if present
        if (!string.IsNullOrEmpty(Autofill))
        {
            textbox.Attributes["autocomplete"] = Autofill;
        }

        base.OnInit(e);
    }
}

Then, You need to create field definition item under, Name it "Extended SingleLineText":

/sitecore/system/Modules/Web Forms for Marketers/Settings/Field Types/Custom/

Set the assembly name and class name to use the class you created for this field, Then you can use your new field which by default will disable autocomplete/autofill for you, since the autocomplete is set to "off".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.