Web Forms

This lesson will teach you how to create a web form on a Drupal website hosted at the Baskin School of Engineering.

This lesson assumes that you have logged in to your Drupal site.

Please note that this feature is not enabled on all BSOE web sites. If you would like to enable this feature on your web site, please send an e-mail to webmaster@soe.ucsc.edu with the web site URL on which you want to enable the feature.

Web forms are a great way to create a questionnaire on your web site. Web forms can be used to allow people to register for an event (as long as there is no registration fee), to poll user opinions, to allow users to submit requests for more information, and much more.

Web forms start out very similar to web pages. Click the Add Content link in the menu, followed by Web Form. Give the web form a title, and add some introductory text that will be shown to the user immediately above the web form questions. For most web forms, you'll want to check the Provide a Menu Link checkbox. Click Save.

Once the web form page has been created, you can start adding form components. Each form component is a single question. For example, your first component might ask the user for their full name, and your second component might ask the user for their e-mail address. It's common to ask for these two pieces of information first so that you can e-mail the user once they've submitted the form. Then you can add any number of additional questions. There are several question types - text fields, for single-line input boxes, text areas - for multi-line input boxes, select options - for drop-down, check box or radio button questions, and more.

You can also arrange your questions into fieldsets to help the user make not feel lost on very large web forms. For example, it's common to group all the fields pertaining to the person's identity in a fieldset called Your Information. Then you might create another field set for RSVP Information. As always, be sure to click Save after re-arranging form components.

Once you have created all your questions, you should go over to the Web Form tab, and then the Form Settings sub-tab. This page lets you control how the form works. You can enter some confirmation text that will be displayed to the user once they're submitted the form. You can limit the total number of form submissions (for example, if you only have 50 slots for which you can accept registrations), and you can also limit each user to submitting the form just one time. You can also require that users log in using their CruzID and Blue password by un-checking the Anonymous checkbox.

The next thing you may want to do is to configured e-mails. You can configure your web form to send one or more e-mails each time someone submits the web form. It's common to send the user a confirmation e-mail. To do so, select the Your E-Mail Address form field, and then click the Add button. You can customize the E-Mail Subject, the E-Mail From Address and the E-Mail From Name. You should also edit the E-Mail Template to include an introductory paragraph and the [submission:values] token. Be sure to click Save E-Mail Settings when you are done.

It's also common to have the system e-mail you, the form creator, when someone submits the form. To do so, enter your e-mail address and click the Add button. You can again edit the E-Mail Subject field as before, but this time you should select the Your E-Mail Address field and the Your Full Name fields so that the e-mail you receive will come from the user's name and address. This makes replying to the e-mail much easier. On this copy of the form submission e-mail, you may want to put only the [submission:values] token into the e-mail template.