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.

Supporting organizations: 
Created for MSU Libraries projects, shared to the wider community.

Project information

Releases