Last active
August 18, 2021 13:57
-
-
Save rafiahmedd/15a25293a1224cf58c2250411f318c77 to your computer and use it in GitHub Desktop.
Match two email to in Fluent Forms for multiple forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluentform_validate_input_item_input_email', function($errorMessage, $field, $formData, $fields, $form) { | |
$targeted_forms =[22,23,24,25]; | |
$target_form_id = 0; | |
foreach ($targeted_forms as $id){ | |
if($form->id == $id){ | |
$target_form_id = $id; | |
} | |
} | |
if($form->id != $target_form_id ) { | |
return $errorMessage ; | |
} | |
if( $formData['email'] != $formData['email_1'] ){ | |
$errorMessage= ['Error! Email does not match']; | |
} | |
return $errorMessage; | |
}, 10, 5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment