• Resolved andriiwork

    (@andriiwork)


    Hello All.
    I use last version 6.4.2, and activate validation on Register Form (Only English letters), when I write Russian text in fields and click Registration button, I don’t see error message and I can register.

    Maybe someone had such a problem and knows how to solve it?
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • missveronica

    (@missveronicatv)

    @andriiwork

    I tried to find the UM PHP code where this “English letters only” is being validated and it’s not being implemented at all.

    I have made an UM Bug report about your issue.

    https://github.com/ultimatemember/ultimatemember/issues/1417

    Thread Starter andriiwork

    (@andriiwork)

    Thanks! @missveronicatv

    You help me ??
    This code work. (I have 4 language in my site).

    function um_custom_validate_english_language( $key, $array, $args ) {
        if ( preg_match('/[^A-Z?????ó???a-z????ńó???0-9-]/', $args[$key] ) )  {
    		    if (is_page('2974') && get_the_id() == 2974){
    				UM()->form()->add_error( $key, __( 'Пожалуйста, используйте только Английские буквы', 'ultimate-member' ) );
    			}
    		    if (is_page('6412') && get_the_id() == 6412){
    				UM()->form()->add_error( $key, __( 'Будь ласка, використовуйте т?льки Англ?йськ? л?тери', 'ultimate-member' ) );
    			}
    		    if (is_page('6424') && get_the_id() == 6424){
    				UM()->form()->add_error( $key, __( 'Please use only English letters', 'ultimate-member' ) );
    			}
    		    if (is_page('6432') && get_the_id() == 6432){
    				UM()->form()->add_error( $key, __( 'Prosz? u?ywa? wy??cznie Angielskich liter', 'ultimate-member' ) );
    			}
        }
    }
    add_action( 'um_custom_field_validation_english_language', 'um_custom_validate_english_language', 30, 3 ); 
    • This reply was modified 1 year, 1 month ago by andriiwork.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Validation’ is closed to new replies.