Webform Cookbook

Recipes and code snippets for altering Webform 8.x-5.x forms and behaviors.

Checkboxes & Radio buttons as images

A recipe for displaying checkboxes and radios buttons as images.

How can you automatically create a default email handler for a webform when it is created

A recipe showing how can you automatically create a default email handler for a webform when it is created

How to add custom validation to a webform element?

A recipe showing how to add a custom validation to a webform element.

How to alter a Webform's settings before rendering a submission form

A recipe showing how to dynamically alter a Webform's settings before rendering a submission form.

How to alter local tasks (aka tabs)

A recipe for how to alter the Webform module's local tasks (aka tabs).

How to alter properties of a composite's sub-elements.

A recipe for altering properties of a composite's sub-elements, including #title_display and #weight.

How to automatically create a Webform node when creating a adding Webform

A recipe showing how to automatically create a Webform node when adding a new Webform

How to create a custom Views exposed filter form [VIDEO]

A video showing how to create a custom Views exposed filter form.

How to create an optional different billing address composite element

A recipe for creating a optional billing address using custom #states.

How to customize a select menu's #empty_option

A recipe showing how to customize a select menu's #empty_option

How to customize the text for a file (upload) input

A recipe for customizing the text for a file (upload) input.

How to disable the field "Default webform submission data (YAML)"?

A recipe showing how to alter a webform entity reference widget to hide the "Default webform submission data (YAML)" element.

How to embed a Webform?

A recipe showing how to embed a Webform.

How to enable the Webform test modules

A recipe showing how to enable the Webform's test module.

How to help with the Webform issue queue

Recipes and code snippets for helping with the Webform issue queue

How to hide form and element settings

A recipe showing how to use form alter hooks to hide form and element settings.

How to implement client-side calculations

A recipe showing how to implement client-side calculation using the Webform module.

How to improve webform client-side validation [VIDEO]

A video showing how to improve webform client-side validation using the Clientside validation module.

How to move status messages under a multi-step wizard's progress bar

A recipe showing how to move status messages under a multi-step wizard's progress bar.

How to programmatically hide and show webform elements.

A recipe for hiding and showing webform elements using a form_alter hook with the #access property.

How to programmatically add a handler to a new webform

A recipe for programmatically adding a handler to a new webform.

How to programmatically alter destination email address

A recipe showing to how to programmatically alter the destination email address.

How to programmatically create a submission

A recipe showing how to programmatically create a submission.

How to programmatically skip pages in wizard forms

A recipe showing how to programmatically skip pages in wizard forms.

How to remove the option to select other webforms when a specific form is associated with a specific content type

A recipe showing how to remove the option to select other webforms When a specific form is associated with a specific content type.

How to support conditional Logic with multiple forms on the same page

A recipe showing how to support conditional Logic with multiple forms on the same page

How to track a webform submission's geolocation [VIDEO]

A video showing how to track a webform submission's geolocation.

How to track webform element create, update, and delete operations

Describes how to retrieve webform elements that have been created, updated, and deleted.

Options: French departments

French departments

Guide maintainers