Skip to end of metadata
Go to start of metadata

The Drupal webform module makes it easy for you to design and deploy detailed surveys for collecting information from your users.  It also facilitates the analysis of the collected data by providing both web-based statistics and point-and-click Excel export capabilities.

Step-by-step guide

 

Step 1: Initial setup

In the menu at the top of the screen, choose "Content management > Create content > Webform".

You can give your new webform a title, description, and place in the menu hierarchy just the same as you would for any other Drupal node. Then click "Save". After you click save, you will be taken to Webform tab where you can configure other settings and begin adding fields to your form.

Step 2: Setup e-mail notifications

Its likely you will want to be notified each time someone has submitted your form. If this is the case, you can go ahead and add an e-mail address you want the form results sent to, and a confirmation message for the user first. Click the "E-mails" menu within the webforms tab (see image below).

 

You can edit an existing notification by clicking "edit" next to the current notification.  See screencap below:

Or you can Add a new notification by typing an e-mail address into the Address field and then clicking the "Add" button. 

Enter an address in the field and click "Add". You will be presented with some other options at this point, but most people leave those settings as the default settings.

Click Save.

Step 3: Setup confirmation message after form is submitted

If you would like to thank the user for submitted your form, or send them to another page for additional direction or information, you will want to configure the confirmation settings. To set the confirmation message, click the "form settings" menu within the webforms tab (see image below).

 

Enter the message you would like the user to see after submitting the form. By default it will show the message on a completely blank page, but you are able to change the settings to redirect a user to a completely different page, or to have the form submit back to the same form page. If you send the user to a completely different page, the confirmation message is ignored.

Don't forget to click "Save".

 

Step 4: Creating Form Fields

If you are ready to add fields to your form, click the "form components" menu within the webforms tab (see image below).

 

The most common field types used in forms are:

  • E-mail
  • Textfield
  • Textarea
  • Select Options

You are free to experiment with any other option but we will provide more information on these four below.

The Email Address Field

In the "New component name" text field, enter "Email Address".

In the "Type" column next to it, choose "email".  This will help Drupal validate users' form submissions (for instance, if a user accidentally enters a phone number here, Drupal will remind the user to correct the error before submitting the form).

If you check the "Mandatory" checkbox, users will be required to provide a value for this field before submitting the form.

Click the "Add" button.

The Textfield

In the "New component name" text field, enter a label to be displayed with your field.

In the "Type" column next to it, choose "textfield". 

Textfield is the simplest of all fields. The only setting you may be inclined to change is to make the field required by checking the "Mandatory" box.

The Textarea field

In the "New component name" text field, enter a label to be displayed with your field.

In the "Type" column next to it, choose "textarea". Textarea has a few options you may want to configure. There is a "description" field that you can use to display instructions to the user for what kind of information you are requesting.  You can also require the field by checking "Mandatory". You will see fields for width and height where you can define how wide and tall you want the textarea box. By default, the field is set to be resizable by the user so they can drag the size to make data entry easier.

The Select Options Field

In the "New component name" text field, enter a label to be displayed with your field.

In the "Type" column next to it, choose "Select Options".

There are several options associated with the Select Option field. The most important is defining what you want to be available in the select options and whether or not a single or multiple options can be chosen by a user. See image below.

 

Step 5: Save & Test

After configuring your settings, click "Save". Then go to the form you just created, by clicking the "View" tab, and submit it to make sure you get the email confirmation and the confirmation message you setup.