Jump to content

Проверка email кириллица, регулярное выражение validate cyrillic email!


support

Recommended Posts

support
// Add Custom Email Validation
jQuery.validator.addMethod('customemail', function (emailaddr, element) {
      emailaddr = emailaddr.replace(/\s+/g, '');
      return this.optional(element) || 
      emailaddr.match(/(^$|^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([а-яА-Яa-zA-Z\-0-9]+\.)+[а-яА-Яa-zA-Z]{2,}))$)/);
 });

 

	$("#<?php echo $form_id; ?>").validate({
		onsubmit: false,
		rules: {
			email_address: {
				required: true,
				minlength: <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>,
				customemail: true,
				//email: true
			},
		},
		messages: {
			email_address: "Введите корректный E-mail",
		},
    onfocusout: function(element) {
        $(element).valid();
    },		
	});

 

Link to post
Share on other sites
×
×
  • Create New...