An online form (HTML form) allows users to fill out information on your website and can be used to capture a variety of data/information. In GovCMS, forms can be created in the following ways:
Creation of a custom form (this requires expertise and would be done by a developer)
Creation of a new Content Type that’s made available to all users (this isn’t a good method because you don’t want public submissions mixed with your other site content)
Configuration of GovCMS’s "Contact Module" to create your online form (easy to do but functionality is limited)
Creation of a new webform using the "Webform Module" (recommended option)
Webform module/content type
The webform template is accessible from the content management area of GovCMS. Completed forms can be sent to a specific email address or downloaded in bulk.
Webforms are good if you want to:
Setup a complex ‘contact us’ form
Add a survey to your website
Include a feedback form on your site
Add an order form to your site
Note: In GovCMS 8, each Webform is an independent entity; to attach metadata to Webforms it has to be referenced from a Webformcontent type. This approach allows for broader use-cases of webforms as independent entities and means they can be reused in multiple places.
Exercise 11.1: Create a basic webform
In this exercise we'll create a simple website feedback form.
In the NavBar go to Content.
Click Add Content.
Note the message at the top of the page:
Before we can create a Webform page and attach a webform entity to it, the entity must exist. Let’s create our first webform entity. Click the created link in the warning message to create the webform.
From the Webform page click the Add webform button.
Give your Webform a title like "Simple Feedback Form", then enter an optional Administrative description and add a Category (if required). Open your webform for submissions by selecting its Status as Open:
You’ll be redirected to the webform building interface (the Build tab is active), so you can add elements (fields) to your webform, configure various conditions and much more.
Click the Add element button and add a simple "text field" element for the Feedback field.
Fill out the Title field.
Note the other tabs that allow you to configure the field - Conditions, Advanced properties and Access. Explore those tabs but do not modify anything yet. Save your field when you’re ready.
Do not move away from your Elements page without pressing the Save elements button.
Have a look at your Webform by clicking the View tab. To return to the Webform Build interface, click the Build tab at any time. If you moved away from your webform, use the top navigation to return to the form via Structure → Webforms → [select the webform from the list].
Note that the Feedback field label is displayed inline with the field. Let’s move it above the field.
Return to the webform build interface and place the Feedback field label above the field.
Make your Titledisplay selection match the screenshot.
Navigate to the Advanced tab, expand the Label attributes pane and add Label CSS Style to match the screenshot:
Return to the General section and make the Feedback field Required
Press Save and review the form you created.
Submit your new form (a few times if you like)
Exercise 11.2: Attach a feedback form to a Webform
In this exercise we attach the webform created in Exercise 11.1 to a webform page, so that it’s accessible by the public and can have other attributes available to content types (for example, we could place it on a custom URL, attach to a site navigation menu, add metadata and use moderation workflow).
Create Webform content (Content → Create Content → Webform). Give it a title and fill in some information with the form submission guidelines in the Body field.
In the Webform field, select the webform created in the previous exercise.
Explore the Webform Settings field, but do not modify anything there.
Attach the Webform to the main navigation - see the screenshot:
Under the URL alias field, create a custom URL for your feedback webform
Publish the Webform and review it. Ask your trainer if you have any questions.