custom error msg for existing email
-
hi.
I have a form which takes customer email. When the customer enters an email already registered, the default prompt in UM is “This email is incorrect”. I need to change this because obviously its misleading. This is what I’ve put in the functions.php
function um_custom_validate_email( $args ) {
if ( isset( $args['user_email'] )) {
if (email_exists($args['user_email'])) {
UM()->form()->add_error( 'user_email', 'This email address is already registered.' );
}
UM()->form()->add_error( 'user_email', 'Email is required.' );
}
}
add_action('um_submit_form_user_email','um_custom_validate_email');
I have set the form field validate to ‘custom validate’ and the custom action to ‘user_email’. Nothing happens. No error prompt appears. What am i doing wrong?
I’d appreciate any help.Thanks,
drab
- The topic ‘custom error msg for existing email’ is closed to new replies.