Asp点击输入框显示验证码

<%
if request("cur_action")="add" then
code=Request.Form("code")
if code=empty then
response.write "<script LANGUAGE='javascript'>alert('请输入验证码!');history.go(-1);</script>"
Session("GetCode")=empty
response.End()
elseif lcase(code)<>lcase(Session("GetCode")) then
response.write "<script LANGUAGE='javascript'>alert('您输入验证码出错!');history.go(-1);</script>"
Session("GetCode")=empty
response.End()
Else
Response.Write "<script>alert('登陆成功');history.back();</script>"
response.End()
end if
end if
%>
<form name="form" method="post" action="index.asp">
<SCRIPT LANGUAGE=javascript>
/*显示认证码 o start1*/
function get_Code() {
var Dv_CodeFile = "Dv_GetCode.asp";
if(document.getElementById("imgid"))
document.getElementById("imgid").innerHTML = '<img src="'+Dv_CodeFile+'?t='+Math.random()+'" alt="点击刷新验证码" style="cursor:pointer;border:0;vertical-align:middle;height:18px;" onclick="this.src=''+Dv_CodeFile+'?t='+Math.random()" />'
}
/*o end*/
</script>
<script language="JavaScript" type="text/javascript">
var dvajax_request_type = "GET";
</script>
<script language="JavaScript" src="dv_ajax.js" type="text/javascript"></script>
<tr>
<td style="width:100px; text-align:right">验证码:</td>
<td style="width:150px; text-align:left"><!--验证码表单-->
<p>
<input type="text" name="code" id="code" size="4" maxlength="4" tabindex="6" onfocus="get_Code();this.onfocus=null;" onkeyup="dv_ajaxcheck('checke_dvcode','code');" />
<span id="imgid" style="color:red">点击获取验证码</span><span id="isok_code"></span></p>

<input name="cur_action" type="hidden" value="add">
<input name="提交" type="submit" id="提交">
</td>
</tr>
</form>
如果您觉得我的文章有帮助,请随意赞赏!

*发表评论

用QQ账号登录  请登录后发表评论