The Drupal template system offers a feature to create an online form or survey for site visitors. Some useful features of the webform include:
- Highly customizable forms/surveys. You can add any number of fields to a form that an end-user can fill out and submit.
- Confirmation emails. Once a webform is completed and submitted by the site visitor, the user is sent a customizable confirmation email.
- Configure the webform to redirect end-user to a different page or URL after submission.
- Submission notification emails. Additionally, the website administrator can receive an email notification that a form submission has been received.
- Turn on/off the submission period. You can control when to open a form to accept submissions and when to close the submission period. This is useful for recurring or annual submission events.
The webform feature also offers several ways to view webform submission results and analytics:
- From the Drupal Admin panel - View form submissions directly from the Drupal admin panel in a list or table view. Form submissions will be stored in the Drupal database.
- Email - configure webform results to be emailed.
- Export to a spreadsheet - Export form submissions into an Excel spreadsheet or delimited text file.
- View high-level analysis of submitted data, such as the number of submissions per webform component, calculations, and averages from the drupal admin panel.
Creating Webforms Step-By-Step:
- Step 1: Create the webform
- Step 2: Add and Configure Webform components
- Step 3: Configure Email and Form Settings
- Step 4: Review Submission Results
- How to open or close a form
From the Admin toolbar, click Manage > click Add Content > click Webform
- Enter the title of the form
This is what will appear in large font at the top of the page.
If the "Enable Captcha" option is checked, it will add a CAPTCHA image to the end of the form to protect against bots. As of July 2018, this option is no longer necessary, thanks to a newer layer of protection that filters out non-legitimate submissions invisibly. If you find that spambots are successfully submitting your form, feel free to enable the CAPTCHA image as a second layer of protection; please also inform us of this situation. Additionally, be aware that the CAPTCHA image service is blocked in China, and possibly other countries, making your form unusable.
- Body (see WYSIWYG editor instructions)
This is the text that will appear above the form; generally, it is used for a description or instructions.
- Generate automatic URL alias (Permalink)
Most times you want to let Drupal choose the automatic alias for the page. However, there are times when you want to specify a URL for a particular page. You can uncheck the “Generate automatic URL alias” box and enter your own custom URL. Be sure to avoid special characters when choosing a URL.
- Click Save once the webform is created. You can then begin adding form components.
There are many types of webform components (fields) that can be added to a form. The most common are text fields, email fields, and text areas. You can also create a form that allows file attachments such as .doc and .pdf files.
Add a new component:
- From the Admin toolbar, click Manage > click Content > click Edit next to the webform you want to configure.
- In the upper right, click the Webform tab > click Form Components
- Enter a label name in the New component field
- Choose the component type from the dropdown
- If the field will be required, check the required box.
- Click Add
- The next form gives you several options to configure the component. Fill in the fields as desired.
- Click Save Component at the bottom.
- Continue to add additional form components as desired.
- You can drag and drop form components to reorder.
- Use component type "Fieldset" to create a nested component group
- Use the "Clone" operation to make a copy of a component that was already configured
Email Confirmation Settings
Form submissions will be stored in the database, but the results can also be emailed upon submission. To send submissions to an email address add the address to the email field and click save.
- In the upper right of the webform you are configuring, click the Webform tab > click E-mails
- This form allows you to configure how the site admin should be notified of form submissions.
- Complete fields as desired.
- Click Save e-mail settings at the bottom.
The form settings page allows you to enter a confirmation message. You can also choose if you want the user to be redirected to a different page or URL after submission.
- In the upper right of the webform you are configuring, click the Webform tab > click Form Settings
- You can configure form settings such as limiting the number of submissions and what users can submit. Generally webforms are open to the public but you can limit access to authenticated users, if you choose.
- Complete all fields as desired.
- Click Save Configuration at the bottom.
There are 4 ways you can review form submission data:
1. via email (described in the step above)
2. From the Drupal results screen
In the upper right of the webform you are working on, click the Results tab
3. From the Drupal table view
In the upper right of the webform you are working on, click the Results tab > click Table
To download the submitted form information:
- In the upper right of the webform you are working on, click the Results tab > click Download
Choose the format to download and any export options and click Download.
If you only wish to download the data that your users have entered in the detail fields, and not the technical details about their submission session, you can uncheck the box Submission information under the Included Export Components section.
Is your form only active for a certain timeframe? You can "turn off" your form once your deadline for completion has passed.
1. Make sure that you are on the Webform tab.
2. Click the Form settings option.
3. Click the desired radio button to turn the form to an Open status or a Closed status.
You cannot change the default text of the Closed status, but you can click the Edit tab and add any text you wish to explain that the deadline has passed, the submission form will open again at a certain date, or any other details you choose.
Aways remember to click the Save configuration button at the bottom of the screen to save your changes.