jenhuls
9/7/2016 - 3:24 PM

Gravity Forms compare fields to make sure they don't match

Gravity Forms compare fields to make sure they don't match

add_filter( 'gform_field_validation_1_91', function ( $result, $value, $form, $field ) {
    $master = rgpost( 'input_7' );
    if ( $result['is_valid'] && $value == $master ) {
        $result['is_valid'] = false;
        $result['message']  = 'Please enter a name.';
    }

    return $result;
}, 10, 4 );