Module Review: Webform

Drupal Webform module

The Drupal Webform module is a great tool for creating a variety of web forms, particularly surveys. And although it has a lot of very useful features, this module isn't going to be the answer to all of your Drupal survey building prayers. In this post I'll walk through the features available in Webform as well as look at some of its limitations.

Let's begin by discussing installation because I think you'll want to include an additional module that I always use, Webform Validation. This handy module allows you to specify such validation rules for your web form as matching field values, regular expressions and many others, so make sure you include it when you're performing your install.

Drupal web form install

I also recommend a few other modules that work together very well with Webform to provide a more full-featured survey builder: Options Element, Select or Other and Mollom. The first two expand your form building/response options and the second is a module that works with the Mollom anti-spam service, which in my opinion is a much more user-friendly alternative to straight CAPTCHA.

After you've completed installing and enabling the modules, you'll notice that you have a new content type available when you go to create content.

Webform content type

Upon clicking to create Webform content, you'll be directed to a form that may not be exactly what you're expecting. You'll be presented with only title and body fields instead of anything that looks like a form builder. The title will obviously be the title of your node, but the body should be the content you want at the beginning of your survey. An important note here about the Webform content type is that by default it is enabled to accept comments. I typically don't want user comments at the end of my surveys, so I modify the content type to hide them, but they can also be disabled on a node by node basis.

You're next directed to the form building screen. It's very intuitive with the ability to select a wide range of input types including HTML markup, select options, email and page breaks (that's right, support for multi-page surveys). After selecting a particular input type you're directed to further configure the field and this is another area where I think Webform really shines. 

Webform survey builder

You can easily set basic validation and display options as well as take advantage of some built-in productivity helpers like select lists that are pre-populated with country names, US states or days of the week. When you're ready for more advanced validation, look at the Form validation sub-tab under Webform (put there by the Form Validation module). There you can define a wide variety of validation rules and select which form elements they should be applied to.

Drupal Webform validation

There are two other important sub-tabs under Webform: Emails and Form settings. The first allows you to configure an email address where form submissions can be sent, however, the email leverages the Token module so you can have messages sent upon each survey submission that contain quite a bit of information.

The Form settings sub-tab has some very useful functionality including limiting the number of submissions and redirecting the survey participant to a custom URL after submission (again, includes Token support).

Another great feature of Webform is how it handles results. You can view the submissions individually or in a table and the module even does some rudimentary analysis. Of course you can also export your data and there is support for both Excel and a wide range of delimited formats.

Despite all these great features, Webform isn't the right tool for every survey. A lack of support for branching and skip logic are just two issues that will confront someone looking for a robust Drupal survey tool. If this sounds like you, the bad news is, there isn't a better survey module than Webform for Drupal. One option a lot of people end up looking at is LimeSurvey because it's a PHP-based solution just like Drupal. 

That said, the Drupal Webform module is an excellent solution for building a variety of different types of web forms, including relatively simple surveys. When talking about great modules like Webform, however, the developers behind them don't often get mentioned. I'd like to shine the spotlight on Webform's author, Nathan Haug, who is also responsible for the File, Image and Fivestar modules and made my list of best Drupal developers. Without the work of developers like Haug, the job of Drupal website managers would be a lot more difficult.