Book Image

Drupal 7 Webform Cookbook

By : Vernon Denny
Book Image

Drupal 7 Webform Cookbook

By: Vernon Denny

Overview of this book

<p>The Drupal Content Management System puts everyone in charge of their own internet destiny. Webform takes this power a step further by ensuring that you are never more than just a few mouse-clicks away from fully functional information-gathering forms. From simple contact forms to advanced web applications, Webform provides a solid tool set for both the novice and the expert.<br /><br /><em>Drupal 7 Webform Cookbook</em> gives you everything you need to achieve in minutes what previously cost hours in development and testing. Practical demonstrations of every facet give both the technical and the not-so-technical users an in-depth understanding of how things work.<br /><br />Install. Use. Customize. Extend. A mammoth learning curve devoured in small bytes: all digestible, with no choking.<br /><br />From designing coherent forms, to sending pretty HTML emails and managing data, explore the rich scope of possibilities that Webform enables. Also, easily extend and tune Webform with custom components and functionality.<br /><br />With <em>Drupal 7 Webform Cookbook</em> you are placed firmly in the driving seat.</p>
Table of Contents (18 chapters)
Drupal 7 Webform Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Preface

Consistently ranked in the top 15 of the most installed Drupal contributed modules (see http://www.drupal.org/project/usage), Webform has proven to be a must-have extension on Drupal websites the world over. There is simply no better way to rapidly create forms on our Drupal websites.

After taking an in-depth look at working with Webform components and submitted data, we delve into enhancing our forms with some programming exercises that introduce the Webform API. Of course, no Drupal module is an island, so we cover several of the contributed modules that extend Webform to add value to our forms and the way they are experienced.

What this book covers

Chapter 1, Setting up Webform, explains how to install the Webform module and covers a brief discussion of the Webform configuration options.

Chapter 2, Trying Out Webform, introduces Webform components, building, and testing our first Webform module.

Chapter 3, Working with Submissions, covers the Webform backend and explains how to work with data submitted to our form.

Chapter 4, Discovering More Components, continues the exploration of available Webform components.

Chapter 5, Tweaking the Form Settings, covers how to customize our form’s user interface and feedback to respondents.

Chapter 6, Extending Webform, discovers additional modules to enhance the user experience of our form, protecting our forms with CAPTCHA, and an introduction to the Webform API.

Chapter 7, Theming Webform, explains how to make use of the Drupal theming layer to give our form a look and feel all of its own.

Chapter 8, Acting on Webform Submissions, creates custom modules that interact with user submitted data, adding custom validation rules.

Chapter 9, Creating Webform Components, explains how to build our own custom Webform component from the ground up.

Chapter 10, Creating Submission Actions, discusses carrying out multiple actions with a single click.

Chapter 11, Presenting and Managing Data, explains how to make use of extra modules to produce customized submitted data listings and covers how to keep track of changes made to submitted data.

Chapter 12, Going Out of the Box, discusses displaying and hiding fields based on previous input, validating input data on the client side, and importing submissions.

What you need for this book

To follow along with the exercises and discussions in this book, you will need a working Drupal 7 installation and access to the Internet. Your Drupal installation may be remote (that is, hosted on a web server) or, preferably, a local installation on your PC or laptop.

Some experience with the PHP programming language is recommended before tackling the programming exercises, but this is not an outright requirement as the code samples have been thoroughly tested. The programming tasks covered within this book can be coded with any standard plain text editor, although a programming editor is advised.

Who this book is for

Written as a guide for Internet users and developers alike, Drupal 7 Webform Cookbook gives you the tools needed to turn your Drupal website into an information-gathering superhighway. Basic knowledge of Drupal is required.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: “ This is to ensure that the %useremail token substitution works as expected.”

A block of code is set as follows:

name = Webform Custom
description = Customize Webform Results page.
core = 7.x
package = Webform
dependencies[] = webform

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

name = Webform Custom
description = Customize Webform Results page.
core = 7.x
package = Webform
dependencies[] = webform

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: “The Submit button is universally understood as it appears on a majority of forms on the Internet.”

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.