It is not built-in. You can use the cforms2_after_processing_action hook to compare two fields and throw an exception if they do not match.
Can you explain how this works?
We use the form, so that parents can register their children. We are a kindergarten. Some parents do not type their email address correctly, the data does not reach us. Therefore, it would be convenient if parents have to specify the email twice (without command / strg V). The probability that an error occurs during the input is then not excluded, but less.
many Greetings
1. You can put this hook code to the functions.php
add_action('cforms2_after_processing_action', function ($cformsdata) {
wp_mail('[email protected]', 'my_cforms_logic test', print_r($cformsdata,1), 'From: [email protected]');
});
This will show you the structure of $cformsdata data array which contains the whole form values (the both emails fields)
2. After that you can change the hook and throw the exception like this
add_action('cforms2_after_processing_action', function ($cformsdata) {
if ($cformsdata['data'][email1-...] != $cformsdata['data'][email2-...])
throw new Exception('email address do not match!');
});