Using Custom Forms On Your Website
Most websites have a simple contact form which includes the obvious fields like name, email address, message etc. In many cases most websites don’t need anything else.
But what if your business needs to capture more substantial information from a user, or you want to use logic for what fields are displayed and what information is captured, or you want to do something advanced with the information after you have captured it?
In this case you will need to have a custom form developed. Some use cases for custom forms include:
- Collecting data for a quotation.
- Questionnaires.
- Surveys.
- Creating standalone mini applications.
- Guiding a user through a process to gather specific information.
Basically, any task that requires you to collect data in a particular way, process that data or trigger specific actions, can done with a custom developed form.
There are a variety of tools and methods that can be used to achieve this. WordPress for example has several different plugins that can be purchased that provide form building capability.
Aside from the additional cost, some issues with these plugins are limitations of what can actually be achieved (inflexibility when any requirement is outside of the norm) and a lack of any advanced features for processing and acting on data after it’s been collected. The main problem however is a lack of full integration with the rest of the website data structure.
We create custom forms for our clients using the Drupal Webform module, which not only solves the above problems but is a much more advanced and more flexible tool than any WordPress plugin.
Drupal Webform
The Webform module for Drupal provides all the features expected from an enterprise proprietary form builder combined with the flexibility and openness of Drupal.
The Webform module allows you to build any type of form that can collect any type of data, which can be submitted to any application or system. Every single behaviour and aspect of your forms and its inputs are customisable.
Whether you need a multi-page form containing a multi-column input layout with conditional logic or a simple contact form that pushes data to a SalesForce/CRM, it is all possible using the Webform module for Drupal.
Form Settings
Form behaviours, features, submission handling, messaging, and confirmations are completely customisable using global settings and/or form-specific settings.
Form settings include:
- Open and close date/time scheduling.
- Login redirection with custom messaging.
- Multiple step wizard forms.
- Submission preview.
- Input prepopulation using query string parameters.
Submission Settings
A from submission's labels, behaviours, limits, and draft settings to be customised.
Submission settings include:
- Saving of drafts.
- Automatic purging of submissions.
- Submission limits per user and/or per form.
- Autofilling form using previously submitted values.
Confirmation Settings
The form's confirmation type, message, and URL to be customised.
Confirmation types include:
- Dedicated page.
- Redirect to internal or external URL.
- Displaying of a custom status message.
- Opening a modal dialog.
Email Handlers
Email handlers allow additional actions and behaviours to be processed when a webform or submission is created, updated, or deleted. Handlers are used to route submitted data to external applications and send notifications & confirmations.
Email support features include:
- Previewing and resending emails.
- Sending HTML emails.
- File attachments (requires the Mail System and Swift Mailer module.)
- HTML and plain-text email-friendly Twig templates.
- Customizable display formats for individual form elements.
Conditional Logic
Drupal's State API can be used by developers to provide conditional logic to hide and show form elements based on various conditions, including the value of other fields.
Drupal's State API supports:
- Show/Hide.
- Required/Optional.
- Open/Close.
- Enable/Disable.
Multistep Forms
Forms can be broken up into multiple pages using a progress bar. Authenticated users can save drafts and/or have their changes automatically saved as they progress through a long form.
Multistep form features include:
- Customisable progress bar.
- Customisable previous and next button labels and styles.
- Saving drafts between steps.
Results Management
Form submissions can optionally be stored in the database, reviewed, and downloaded. Submissions can also be flagged with administrative notes.
Results management features include:
- Submission flagging, locking, and notes.
- Viewing submissions as HTML, plain text, and YAML.
- Customisable reports.
- Downloading results as a CSV to Google Sheets or MS Excel.
- Saving of download preferences per form.
- Drupal Views integration for advanced reporting.
Access Controls
The Webform module provides full access controls and permissions for managing who can create forms, post submissions, and access a webform's results. Access controls can be applied to roles and/or specific users. The Webform access submodule allows you to even setup reusable permission groups which can be applied to multiple instances of the same webform.
Access controls allow users to:
- Create new forms.
- Update forms.
- Delete forms.
- View submissions.
- Update submissions.
- Delete submissions.
- View selected elements.
- Update selected elements.
Webform Add-ons
There are dozens of add-ons available that extend and/or provide additional functionality to the Webform module and Drupal's Form API.
Add-ons include:
- Analysis for creating graphs and charts.
- CRM integration including SalesForce, HubSpot, MyEmma, SugarCRM, and more.
- SPAM protection.
- Advanced workflows.
- Data encryption.
- GDPR compliance.
Conclusion
No matter what your requirement may be for using a custom form on your website, the Drupal Webform module will be able to achieve it. We have a lot of experience developing custom forms for clients using Webform and we would love to hear from you if you think we can help you, get in touch.