WFFM Custom Field – Hidden Token Field

One of the most useful custom WFFM fields we use is a custom hidden token field. I’ve used this on several projects for various reasons.

I’ve seen a number of implementations which will use a regular Single Line Text field (or similar) and then hide the field either using JavaScript(?!?!) or CSS by selecting a custom style in the Form Designer. Whilst both kind of work, they’re not ideal – I’ve seen forms fields which are momentarily visible and “flicker” whilst the page loads and it looks a little weird. It also relies on the authors remembering to set the class. Besides, there’s already a hidden input type available in HTML, why not use that?

Read More

Advertisements

WFFM Custom Field – Label

Hopefully a very simple one, however unfortunately it is not possible to add snippets of text in the forms, only to the header/footer or section titles. We often have to provide additional details which may also include HTML links/content.

We solved this problem by creating a custom Label field. There is not suitable existing field to inherit and extend, but it’s such a simple field we can inherit from the CssClassControl field as a base.

Read More

WFFM Custom Field – Checkbox With HTML

A common field requirement seems to be a checkbox which also allows some HTML text, such as when including a checkbox that the user agrees to some Terms & Conditions, Privacy or Legal policy. It’s usually a requirement that links to the policies are provided within the text.

There’s nothing out-of-the-box with WFFM but it’s simple enough to create a custom field.

This is a re-post of an answer I provided on Sitecore StackExchange.

Read More

Multisite WFFM Form Markup using MVC Areas

If you are using the MVC version of the WFFM module then you probably know that by default the templates for the fields are located under /Views/Form/EditorTemplates folder. If you have a multisite implementation then this leads to an issue if you need to render different markup for different sites. Generally speaking, my recommendation has always been to try style around the default WFFM markup rather than bending it to your will only to be struck down later when upgrading, but we should try to follow this same advice for most of Sitecore whenever possible anyway.

But sometimes you really really need something different per site.

With the release of Sitecore 8.1 we have had the added benefit of being able to use MVC Areas. We can take advantage of this feature to allow different markup for forms per site.

Read More

Dependency Injection with WFFM

There were a number of changes in the 8.1 release of the Web Forms For Marketers module, it was a fairly significant rewrite but not unusual given the introduction of a number of abstractions within the core product itself. In hindsight, all this was just setting the stage for the introduction of Dependency Injection in Sitecore 8.2.

One of the big changes in WFFM now allows us to inject dependencies into Save Actions using configuration. I’ve not seen this blogged previously and the documentation is a little sparse on this subject so thought it is worth reviewing since it has also come up on StackExchange before.

Read More

Sitecore WFFM 101

A introduction and quick start to the Sitecore WebForms for Marketers module, a.k.a f***ing Webforms for f***ing Marketers.

  • What is it?
  • How to install
  • How to create a form
  • How to extend
  • Styling
  • Gotchas

Read More

WebForms For Marketers: Allow selection of existing forms

WFFM. The marmite of Sitecore modules. It’s possibly one of the most commonly used of Sitecore modules but we all love to hate this module. Despite its rough edges, we battle on. I have to admit that I had not used this module in some time; until using it with Sitecore 8 in its MVC guise the last time was over 2 years ago in webforms (ASP.Net, not Sitecore :p).

As improved as it is working with MVC, one thing that frustrated me was creating a bunch of forms only to find that there was a gazillion copies now littered across the site. Why? Because when you add an MVC Form rendering onto the page the only options presented to you is to either create a blank a form or to duplicate an existing one.

wffm-form-selector

Read More