关于检查EmailId是否可用 [英] Regarding checking EmailId available or not

查看:95
本文介绍了关于检查EmailId是否可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script type="text/javascript">
var _txtemailID;
var _divStatus;
var _timeHandler;

function pageLoad()
{
_txtemailID=document.getElementById("<%=txtemailIID.ClientID %>");
_divStatus=document.getElementById("<%=divStatus.ClientID %>")

}
function pageUnload()
{
$removeHandler(_txtemailID,"keyup",onKeyUp);
cleartimer();
}
function onKeyUp(e)
{
setupTimer();
}
function setupTimer()
{
clearTimer();
_timeHandler=window.setTimeout(checkEmail,15000);
}
function clearTimer()
{
window.setTimeout(_timeHandler);
_timeHandler=null;
}
function checkEmail()
{
if(_txtemailID.value.lenght>5)
{
_divStatus.innerHTML=''Checking...'';
_divStatus.style.color=''black'';

PageMethods.checkEmailID(_txtemailID.value,onCheckEmailComplete,onCheckEmailError,_txtemailID.value);
}
else
{
_divStatus.innerHTML='' '';
}

}
function onCheckEmailComplete(result,usercontext)
{
if(result==true)
{
_divStatus.innerHTML=String.fomat(''\''{0}\''\ is Alredy Taken'',usercontext);
_divStatus.style.color=''red'';
}
else
{
_divStatus.innerHTML=String.fomat(''\''{0}\''\ is Available'',usercontext);
_divStatus.style.color=''green'';
}
}
function onCheckEmailError(e)
{
_divStatus.innerHTML = e.get_message();
_divStatus.style.color = ''red'';
}
</script>



很抱歉给您带来不便,
实际上,我想检查TextBox的onBlur事件上的用户名是否可用. 我用aspx编写了该脚本,但是它不提供onBlur事件的可用性.
我该怎么办..



Sorry for inconvinence,,
Actly i want to check the availability of Username on the onBlur Event of TextBox..
I wrote that script in aspx But it does not provide the availability onBlur Event.
What should i do..

推荐答案

removeHandler(_txtemailID,"keyup",onKeyUp); cleartimer(); } 函数onKeyUp(e) { setupTimer(); } 函数setupTimer() { clearTimer(); _timeHandler = window.setTimeout(checkEmail,15000); } 函数clearTimer() { window.setTimeout(_timeHandler); _timeHandler = null; } 函数checkEmail() { 如果(_txtemailID.value.lenght> 5) { _divStatus.innerHTML =正在检查...''; _divStatus.style.color =''黑色''; PageMethods.checkEmailID(_txtemailID.value,onCheckEmailComplete,onCheckEmailError,_txtemailID.value); } 别的 { _divStatus.innerHTML =''''; } } 函数onCheckEmailComplete(结果,用户上下文) { 如果(结果==真) { _divStatus.innerHTML = String.fomat(''\''{0} \''\是Alredy Taked'',用户上下文); _divStatus.style.color =''红色''; } 别的 { _divStatus.innerHTML = String.fomat(''\''{0} \''\可用'',用户上下文); _divStatus.style.color =''绿色''; } } 函数onCheckEmailError(e) { _divStatus.innerHTML = e.get_message(); _divStatus.style.color =``红色''; } </script>
removeHandler(_txtemailID,"keyup",onKeyUp); cleartimer(); } function onKeyUp(e) { setupTimer(); } function setupTimer() { clearTimer(); _timeHandler=window.setTimeout(checkEmail,15000); } function clearTimer() { window.setTimeout(_timeHandler); _timeHandler=null; } function checkEmail() { if(_txtemailID.value.lenght>5) { _divStatus.innerHTML=''Checking...''; _divStatus.style.color=''black''; PageMethods.checkEmailID(_txtemailID.value,onCheckEmailComplete,onCheckEmailError,_txtemailID.value); } else { _divStatus.innerHTML='' ''; } } function onCheckEmailComplete(result,usercontext) { if(result==true) { _divStatus.innerHTML=String.fomat(''\''{0}\''\ is Alredy Taken'',usercontext); _divStatus.style.color=''red''; } else { _divStatus.innerHTML=String.fomat(''\''{0}\''\ is Available'',usercontext); _divStatus.style.color=''green''; } } function onCheckEmailError(e) { _divStatus.innerHTML = e.get_message(); _divStatus.style.color = ''red''; } </script>



很抱歉给您带来不便,
实际上,我想检查TextBox的onBlur事件上的用户名是否可用. 我用aspx编写了该脚本,但是它不提供onBlur事件的可用性.
我该怎么办.



Sorry for inconvinence,,
Actly i want to check the availability of Username on the onBlur Event of TextBox..
I wrote that script in aspx But it does not provide the availability onBlur Event.
What should i do..


添加答案以将其从未答复的列表中删除. OP从未设法提出明确的问题,但他说他已经解决了他的问题
Adding an answer to get this out of the unanswered list. The OP never managed to ask a clear question, but he says he''s solved his issue


这篇关于关于检查EmailId是否可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆