-
-
Save mvazquezmultimedia/ea29d99ca629c85efa698ff1850d9c4d to your computer and use it in GitHub Desktop.
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_action( 'elementor_pro/forms/validation/email', function( $field, $record, $ajax_handler ) { | |
// Get submitted form data. | |
$raw_fields = $record->get( 'fields' ); | |
foreach ( $raw_fields as $id => $field ) { | |
$fields[ $id ] = $field['value']; | |
if ($field[ 'id' ] == 'FirstName'){ | |
$FirstName = $field[ 'value' ]; | |
} | |
if ($field[ 'id' ] == 'LastName'){ | |
$LastName = $field[ 'value' ]; | |
} | |
if ($field[ 'id' ] == 'Email'){ | |
if ( !filter_var( $field['value'], FILTER_VALIDATE_EMAIL ) ) { | |
$ajax_handler->add_error( $field['id'], 'SF Please enter a valid email.' ); | |
} else { | |
// include_once( __DIR__ . '/form-actions/salesforce.php' ); | |
// var_dump($field['value']); | |
// die('Test custom validation'); | |
} | |
} | |
} | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment