Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Webform Handler: Compare Fields

Security covered Maintenance fixes only 84 sites

Part of the Webform ecosystem · 217 projects

This module provides a way to compare the values of two fields within a webform. You can configure it to validate that specific fields either match or do not match each other, offering flexibility in how data types are handled during the comparison.

About

Configurable handler for comparing two fields on a webform.

Installation and Configuration

Install and enable as any other drupal 8 module, no special requirements.

To configure the interface

  1. Navigate to your webform's handlers page (e.g. /admin/structure/webform/manage/form_id/handlers).
  2. Click [+ Add handler] button.
  3. Click [Add handler] next to "Validate Entries by Comparing 2 fields"
  4. Enter the field names and comparison operator and data type information
    • Machine name is generally just the key from the form build page.
    • Allowable operators are "==", "!=", "<>", "<", "<=", ">", and ">=".
      While "===", and "!==" are included for completeness, they are of
      little value as units are hard converted before comparison.
    • Nearly all webform values are strings by default, choose how they
      should be handled if they are different, this is especially critical for
      dates. Both sides of the comparison will be treated as the same type.
    • At this time, both integers and floating point numbers are compared as floats.
  5. Click [Save]
  6. This handler can be added multiple times one one form by repeated the above steps.

MSU required information

Written By Kevin Finkenbinder while working for MSU.

COPYRIGHT © 2019

MICHIGAN STATE UNIVERSITY BOARD OF TRUSTEES

ALL RIGHTS RESERVED

PERMISSION IS GRANTED TO USE, COPY, CREATE DERIVATIVE WORKS AND REDISTRIBUTE THIS SOFTWARE AND SUCH DERIVATIVE WORKS FOR ANY PURPOSE, SO LONG AS THE NAME OF MICHIGAN STATE UNIVERSITY IS NOT USED IN ANY ADVERTISING OR PUBLICITY PERTAINING TO THE USE OR DISTRIBUTION OF THIS SOFTWARE WITHOUT SPECIFIC, WRITTEN PRIOR AUTHORIZATION.

THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM MICHIGAN STATE UNIVERSITY AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT WARRANTY BY MICHIGAN STATE UNIVERSITY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE MICHIGAN STATE UNIVERSITY BOARD OF TRUSTEES SHALL NOT BE LIABLE FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Drupal 10–11

Ask your assistant about Webform Handler: Compare Fields

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Aug 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
2.0.4 Stable 10–11 Jul 11, 2025
2.0.3 Stable Jul 10, 2025
3.0.0-rc1 Pre-release Sep 30, 2024
2.0.2 Stable 8–10 Aug 28, 2023