Confirm Email validation case Sensitive
-
Hi,
I have created a form to assist with registration on my website. I found a code snippet from a previous support thread which will assist in getting the email confirmed.
I want to know if there is a way for the validation to not be case sensitive.
for example:
email-1: info@xyz.com
email-2: Info@xyz.com
This throws an error that the email does not match.
Thanks for assisting.
Below is the code used.
/*-----------------------------------------------------------------------------------*/ /* Forminator Email verification /*-----------------------------------------------------------------------------------*/ add_filter( 'forminator_custom_form_submit_errors', 'check_form_data', 99, 3 ); function check_form_data( $submit_errors, $form_id, $field_data_array ) { $email1 = $email2 = ''; foreach( $field_data_array as $arr ) { if( $arr['name'] == 'email-1' ) $email1 = $arr['value']; if( $arr['name'] == 'email-2' ) $email2 = $arr['value']; if( '' != $email1 && '' != $email2 ) break; } if( $email1 != $email2 ) { $submit_errors[]['email-2'] = 'The email addresses must match!'; } return $submit_errors; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Confirm Email validation case Sensitive’ is closed to new replies.