O'Reilly logo

Drupal® 7 Bible by Brice Dunwoodie, Ric Shreves

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19. Working with Forms

IN THIS CHAPTER

  • Using Drupal's Contact module

  • Creating custom forms

The Drupal system includes a basic contact form feature that site visitors can use to contact the site owner or other users. Drupal's default form functionality is, however, rather limited. Consequently, you may want to consider installing additional modules to enable the creation of custom forms.

In this chapter, I look at both the default Drupal Contact module and at one of the easiest to use third-party form modules.

Note

You need to install an additional module to get the most out of the discussion in the latter portion of this chapter.

Using Drupal's Contact Module

Drupal's default system includes a basic contact form feature. The form is created by the Contact module, which is disabled by default. After you enable the module, the form is immediately ready for use.

The form provides the following fields:

  • Name: This is a single-line text field.

  • Email address: This single-line text field is validated for simple text. (It is not validated for proper e-mail address format.)

  • Subject: This is a single-line text field.

  • Category: This field is a combo box that displays the list of categories created by the administrator in the Contact Manager.

  • Message: This field is a multi-line text box.

  • Send yourself a copy: If a user checks this box, the system automatically sends him a copy of the form submission, using the e-mail address he input in the form.

All the fields on the form are required, and the system ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required