Chapter 6. Extending Webform

In this chapter, we will cover the following topics:

  • Enabling the Select (or other) module
  • Using the Options Element
  • Defining custom option lists
  • Enabling date pop-up
  • Sending HTML e-mails
  • Preventing spam with CAPTCHA
  • Advanced data validation

Introduction

As we build our Webforms we may occasionally identify a need for additional functionality that is not available in Webform. Thankfully, in the vibrant Drupal community, there is often already a solution available in one form or another. Just as the Drupal core can be extended by contributed modules (such as Webform), so too can Webform be extended by contributed modules. In other cases, the Webform maintainers can change programming code to leverage functionality that is made possible by other contributed modules.

In this chapter, we will discover some modules with which we may embellish our Webforms and their functionality. The modules we will cover here do not form a definitive list of what is available, nor is there any negative reflection on modules not described in this chapter. As with any book, there are space constraints that unfortunately enforce a certain amount of pruning.

We should also note that most of the modules we will touch on are broad enough in scope to warrant books all of their own. We will be directing our attention only to those minimal aspects of the modules as are required for our demonstration purposes. Nothing prevents us from further research and experimentation than is described as follows and, usually, the various project home pages will be an excellent place to start.

While the contributed modules described here are all useful in their own right, we should refrain from installing modules that we do not really need, or will not fully utilize. The main reason for this caution is that our site slows down with many modules enabled, because there is more processing being handled by the server. Secondly, the occasional security breaches on Drupal websites come about through one or two inadvertent loopholes created by contributed modules. By limiting ourselves to only those modules that actually contribute to our overall website design and scope, we automatically reduce the chances of a breach, as well as benefiting from a faster loading site.

Note

The methodology for downloading and installing modules was described in Chapter 1, Setting up Webform, under the heading Downloading and Installing Webform. In the following sections it is assumed that the process of installing each module has been successfully completed and that the module has been enabled on the Modules administrative page by checking the required boxes and clicking on the Save configuration button.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset