Working With a Webform
Webforms are used to create input forms that allow visitors to submit information. Only managers can create webforms. They consist of four main parts:
Form components鈥攖hese are the basic form elements that create the form itself (text fields, radio buttons, etc.).
Conditionals鈥攗sed to hide or show form components based on the value of other form components.
Emails鈥攄etermine who gets form submissions and what the content of those emails look like.
Form settings鈥攁dd a submission confirmation message and other settings.
Things to remember
Although there is an encrypted field to collect WIN numbers, it is important to remember that all other fields in webforms are not secure. You should never ask for information such as a person's Social Security number, credit card numbers or even birth dates.
For example, collecting birth dates is problematic on two fronts: first it collects personal identification information that could lead to identity theft and security breach issues. Secondly, if this was for something like a music audition, you don't want to have any claims from rejected applicants asserting that the decision to admit was actually influenced by age, which could lead to a discrimination claim.The simpler and shorter the form, the better. Simple forms include fields for name, email address, phone, subject and message; and phone is usually optional. Only request information that will actually be used, and only require information that is essential.
The output from the form may be sent as an email message to one or more addresses鈥攖here is no Cc: or Bcc:. Ideal for this purpose is an office email address to which multiple staff members have access, and which is checked at least once each business day. Alternately, the messages may go to two or three individual staff email addresses, with one person assigned primary responsibility, and the others available to cover.
How to create a 鈥淐ontact Us鈥 webform
Webforms start out very similar to the Basic page content type. This form will include components for name, email, category, subject and message. "Contact Us" is the bottom link in the section menu and is required on nearly all sections.
Click on Add content in the administration menu and select Webform.
Enter a Title鈥攖he title for a "Contact Us" form should be Contact Us.
Choose the Section to which this webform belongs, if you have more than one.
Add a Custom URL鈥斺淐ontact Us鈥 webforms should have contact entered into this field.
Add text to the Text above the form field if you have particular instructions for your form.
Add text to the Text below the form field. Additional contact information should be listed here. It should minimally include a mailing address and main office phone number, formatted exactly as shown in the example below. Other information can include physical location and campus mail stop, secondary phone numbers for major divisions within the office or department, and general office hours. Although a physical location is optional, it should be included to assist visitors in finding you, since most of the University鈥檚 mailing addresses are not useful for this purpose.
Office of Marketing and Strategic Communications
色色啦 Michigan University
1903 W Michigan Ave
Kalamazoo MI 49008-5433 USA
Phone (269) 387-8400
Location
300E Walwood Hall, Mail Stop 5433Attach media to the Attachments field if necessary.
Press the Save button at the bottom of the page.
Now that you have created the basic page part, we can now add the form elements themselves.
Adding webform fields
Click on the Webform button.
Under the Label table header, click in the field where it says 鈥淣ew component name鈥 and enter Your name in the field.
Leave the Type as Textfield.
Check the required box to make this field mandatory.
Click Add. On the next page you will be given a series of options to change many variables that you can experiment with, but for most components you will not need to modify any of these settings.
Scroll to the bottom of this page and click Save component. This will return you to the Form components view where you will see your component has been added.
Add a field to collect an email address in the form by repeating step 2, except enter Your email in the field.
Change the Type to Email.
Check the required box to make this field mandatory.
Click Add. Again, leave everything on the next page alone.
Scroll to the bottom of this page and click Save component.
Add a Required component with a Label of Category and a Type of Select options and click Save. Now, there are a few things to note:
The Select options Type creates radio buttons, checkboxes and select lists鈥攖he default is radio buttons.
Check the Multiple checkbox to turn the options from radio buttons to checkboxes.
Check the Listbox checkbox to turn the options into a drop-down list.
Never have both Multiple and Listbox checked, the result is unacceptable for mobile devices.
In the Options field enter the following:
faculty|Faculty
staff|Staff
student|Student
other|OtherNote that this uses the pipe "|" character which is created by pressing Shift + \.
Check the Listbox checkbox, scroll down and click Save component.
Add a component with Label Other and Type Textfield to the form. A conditional will be used to expose this field when someone selects Other from the Category select list.
Next, add a Required component with Label Subject and Type Textfield to our form. Leave everything on the next page the same; scroll to the bottom of the page and click the Save component button.
Finally, add a Required component with Label Message and Type Textarea to our form. Leave everything on the next page the same; scroll to the bottom of the page and click the Save component button.
Setting our conditional element
Click on Conditionals
Click the plus sign (+) to begin creating the conditional.
Determine what should happen when a specific condition is met:
If Category is other
then Other is shownClick Save conditions.
Adding emails
Click on Emails.
In the Address field enter the email recipient and click Add. This will take you to the Edit email settings page.
For the Email subject, select the Component radio button and select Subject from the dropdown list. This will use the submitted Subject value as the subject for the email being sent.
For the Email from address, select the Component radio button and select Your email from the dropdown list.
For the Email from name, select the Component radio button and select Your name from the dropdown list.
For the Email template section, replace the default text with the following:
Submitted values are:
[submission:values]
This message was generated from the [current-page:title] at [current-page:url].Be sure to experiment with this as you see fit.
Click Save email setting.
Modifying form settings
For basic webforms it is recommended that you do not change anything on this page, however there are several things to note:
Confirmation message鈥攖his is the message that is shown to users upon a successful submission.
Redirection location鈥攖his is where the user goes after a successful submission.
Total submission limit鈥攖his limits the total allowed submissions.
Per user submission鈥攍imits the number of submissions per user.
Status of this form鈥攃loses the form and prevents any further submissions.
Progress bar鈥攄isplays a progress bar for multi-page forms.
Advanced settings鈥攃ontains a few more options, including the ability to rename the "Submit" button text.