// Validate confirmation email
add_action( 'elementor_pro/forms/validation', function ( $record, $ajax_handler ) {
$form_name = $record->get_form_settings( 'Maggiorenni' );
// Replace MY_FORM_NAME with the name you gave your form
if ( 'Maggiorenni' !== $form_name ) {
return;
}
//Replace MY_FIELD_ID_1 to match the field's Advanced > Field ID
$first_email_field = $record->get_field( [
'id' => 'email'
] );
//Replace MY_FIELD_ID_2 to match the field's Advanced > Field ID
$second_email_field = $record->get_field( [
'id' => 'field_3950bdf'
] );
//Make sure your field ID's are set to match these in each field's Advanced > Field ID
if ( $first_email_field['email']['value'] !== $second_email_field['field_3950bdf']['value'] ) {
$ajax_handler->add_error( $second_email_field['field_3950bdf']['id'], 'Confirmation Email must match the Email field' );
}
}, 10, 2 );
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
I cookie strettamente necessari dovrebbero essere sempre attivati per poter salvare le tue preferenze per le impostazioni dei cookie.
Se disabiliti questo cookie, non saremo in grado di salvare le tue preferenze. Ciò significa che ogni volta che visiti questo sito web dovrai abilitare o disabilitare nuovamente i cookie.