-
-
Save Nakilon/ca77bd47bfff287178ea242f0580cfb2 to your computer and use it in GitHub Desktop.
This file contains 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
fvalidator.setChecker('domain','', function( obj ) { | |
var cur_mail = obj.value.trim().split("@"); | |
if(obj.value && obj.value !== undefined) { | |
check_result = check_domain(obj.value); | |
// console.log(check_result); | |
if( !this.hasOwnProperty('tempMSG') ) this.tempMSG = this.msg; | |
this.msg = this.tempMSG + 'Регистрация для почтовых адресов c '+cur_mail[1]+' запрещена.'; | |
if(check_result) { | |
if(confirm('Вы указали почтовый адрес '+obj.value+' Возможно вы имели виду '+cur_mail[0]+'@'+check_result+'. Исправить?')) { | |
//obj.value = cur_mail[0]+'@'+check_result; | |
fvalidator.visibleError = false; | |
return false; | |
} | |
return true; | |
} | |
else if(check_result === null){ | |
return false; | |
} | |
else { | |
return true; | |
} | |
} | |
return false; | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment