Skip to content

Instantly share code, notes, and snippets.

@Nakilon

Nakilon/some.js Secret

Last active December 29, 2016 18:34
Show Gist options
  • Save Nakilon/ca77bd47bfff287178ea242f0580cfb2 to your computer and use it in GitHub Desktop.
Save Nakilon/ca77bd47bfff287178ea242f0580cfb2 to your computer and use it in GitHub Desktop.
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