用户注册及跟踪代码(三)
您现在的位置: 学网 >> 网站开发 >> ASP教程 >> ASP实例 >> 正文
学网教程

原作者:用户注册及跟踪代码(三)

[ 来源:xue5.com | 作者:原作者 | 时间:2005-5-15 | 去论坛]
2. ASP代码(设立一DSN,请改动begin.asp)
----------------------------------
-----文件reg_step2.asp
<%
ValidCodeLogin=Request.QueryString("VailCodeLogin")
u_name=Request.QueryString("name")

if ValidCodeLogin="" or u_name="" then
Response.Redirect "reg_step1.asp"
Response.end
end if
%>
<html>
<head>
<title>详细信息填写</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/lotsty1.css">
<SCRIPT LANGUAGE="JavaScript1.1">
function isPosInteger(inputVal) {
    inputStr = inputVal.toString()
    for (var i = 0; i < inputStr.length; i++) {
        var oneChar = inputStr.charAt(i)
        if (oneChar < "0" || oneChar > "9") {
            return false
        }
    }
    return true
}

function CheckForm(form) {
    for (i = 0; i <document.forms[0].elements.length; i++) {
        if (document.forms[0].elements[i].type == "text" && document.forms[0].elements[i].value == ""){
            alert("所有内容必须填写!")
            return false;
        }
    }
    if (document.forms[0].email.value.indexOf("@")==-1 || document.forms[0].email.value.indexOf(".")==-1 || document.forms[0].email.value.indexOf("@.")!=-1 || document.forms[0].email.value=="" || document.forms[0].email.value==null || document.forms[0].email.value.indexOf("@")==0){
    alert('E-mail未输入或格式有误,请查看!')
    return false
    }

    if(!isPosInteger(document.forms[0].year.value)){
    alert("年份必须是数字!")
    return false
    }
    if(!isPosInteger(document.forms[0].month.value)){
    alert("月份必须是数字!")
    return false
    }
    if(!isPosInteger(document.forms[0].date.value)){
    alert("日期必须是数字!")
    return false
    }
return true;
}
</SCRIPT>
1
...
学网·特别声明:
本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。本站所有文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题,请联系编辑人员Xababy#Gmail.com,我们尽快予以更正。
设为首页 - 收藏学网 - 关于学网 - RSS订阅 - 版权申明 - 友情链接 - 联系学网 - 网站地图 - 投稿学网
学网·2004-2008版权所有
© CopyRight 2004-2008 WwW.Xue5.CoM.Inc All Rights Reserved
合作、建议、联系::cainiaoo.cn#live.cn QQ:329700200,1103290

学网_致力于提供优质免费的电脑学习教程
陕ICP备05000834号