Add a webform

« Back to the Table of Contents

Webforms are a special type of content that allow you to collect information from your site visitors. This could be anything from a contact form, to event registration forms, to forms that enable patrons to suggest programming. Submissions are stored on the site and can be accessed in table view, downloaded to a spreadsheet, or emailed upon submission to a designated address.

Sample webform content

The following are examples of webform content:

Adding a webform

To add a webform to your site you must be logged in. Navigate using the black admin menu bar at the top of any page to Content > Add content > Webform (at node/add/webform).

Image removed.

Fields on webform content

The Title field is the only required field for webforms. The title will be displayed at the top of the page when it is viewed and will have semantic markup as Heading Level 1, which is important for search engines and screen readers.

The Description field is for a description of the form. Many different formatting options are available, including adding images into the body content.

Remember to save!

Any content you create is temporary until you press the Save button at the bottom of the create content form.

You may also want to add content to the navigation menu or configure different publishing options before you save.

Webform configuration

Webform configuration takes place under the Webform tab of a webform node. There are three subtabs for webforms that contain the options for configuration: Form components, E-mails, and Form settings. The options for each will be explained below.

Form components

After saving the webform node for the first time, the Form components configuration page will be displayed.

Image removed.

To add a component to your form you must create a label for the component. Then you must select the type. See below for descriptions of commonly-used component types. From this page you can also choose whether or not to make the component mandatory, meaning the form cannot be submitted without a response in this component. Finally, to finish adding the component to your form, click the Add button in the last colum.

After clicking the Add button, you will be taken to the Edit component page which will allow you to set more options for each component of your form. The following is a list of commonly-used component types and their unique options.

  • Textfield - used for a single line form component; names, phone numbers, and short phrases are the expected responses in this component type.
  • Textarea - used for a multi-line form component; if a paragraph of text is required from the submitter use this component to give room for the response; the size of the text area can be configured on the edit component page.
  • E-mail - used for e-mail addresses; this component will validate e-mail addresses to make sure they are formatted correctly; this component can also be used as the receiving address for an automatic response to a form submission.
  • Select options - used for giving the submitter a choice between options; this component can appear as checkboxes, radio buttons, a single-select list, or a multi-select list depending on the configuration; the list of options requires special formatting: a machine name as a key, the pipe character, and a human-readable label (which will look like my_machine_key|Option the User Sees or buenavista_branch|Buena Vista Branch); the help text for these options is very useful.

E-mails

The E-mails subtab is for configuring any notification emails that should be sent after a visitor fills out the form. These emails can be sent to preset email addresses or to email addresses collected on the form.

For example, if your library has an "Ask a librarian" form on the site, the form submission should be emailed to a librarian at your library after it is submitted. You would choose "Address" and enter the proper destination address for the form submission. After clicking the "Add" button, options appear allowing you to customize the email that will be sent to the librarian. An E-mail subject, an E-mail from address, an E-mail from name, and an E-mail template can all be customized for this message.

Additionally, you may want to also send a message to the submitter of the form thanking them for their inquiry and letting them know a librarian will be getting back to them shortly. If you choose "Component value" for a new e-mail destination, and select the E-mail component that you created on your form for the user to fill out, whatever address the user has entered in the form will get a message upon submission. The same message customization options will be available for this second message and are separate and distinct from the customizations for the librarian message.

Image removed.

Form settings

The Form settings subtab has configuration for a confirmation message after a visitor submits the form, and other general configuration settings. The help text for each option on this page is very useful.

The Confirmation message for the form will be displayed either on its own page or as a message at the top of a page, depending on the settings. The Redirection location determines where a user is sent after submitting the form. Users can be sent to a confirmation page that displays only the confirmation message, a custom URL that will show the confirmation message if it is a local path, or users can remain on the form page and it will be reloaded with a confirmation message at the top.

Submission limits are available on webforms as both total submission limits, meaning you can restrict a form so it can only be used a certain number of times in a given period, or per-user submission limits, meaning users can only submit the form a certain number of times in a given period. It is recommended to set the Per user submission limit to 3 submissions every hour so that spamming is not an issue.

Image removed.

The text for the Submit button on a webform can easily be customized under Advanced settings at the bottom of the Form settings subtab.

Image removed.