预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共16页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

Javascript程序和实例代码//表单验证函数functioncheckform(){//验证用户名是否为空username=document.form1.username.value;if(username==""){alert("请输入用户名");document.form1.username.focus();returnfalse;} 验证:用户名必须为英文字母、数字以及_组成 for(nIndex=0;nIndex<username.length;nIndex++){cCheck=username.charAt(nIndex);if(!(IsDigit(cCheck)||IsAlpha(cCheck)||cCheck=='_')) {alert("用户名只能使用字母、数字以及-、_和.,并且不能使用中文");document.sform1.id.focus();returnfalse;}}//验证密码字段是否为空password=document.form1.password.value;if(password==""){alert("请输入登陆密码");document.form1.password.focus();returnfalse;} //验证密码字段两次输入是否相同 password1=document.form1.password1.value;if(password>password1){alert("重复密码与登陆密码不相同");document.form1.password.focus();document.form1.password1.focus();returnfalse;}if(password<password1){alert("重复密码与登陆密码不相同");document.sform1.password.focus();document.sform1.password1.focus();returnfalse;}//验证email字段是否为空 if(document.form1.email.value==""){alert("请输入您的E-MAIL地址");document.form1.email.focus();returnfalse;} //验证email字段输入是否合法email=document.form1.email.value;emailerr=0for(i=0;i<email.length;i++){if((email.charAt(i)=="@")&(email.length>5)){emailerr=emailerr+1}}if(emailerr!=1){alert("请输入正确的E-MAIL地址");document.form1.email.focus();returnfalse;}if(document.form1.checkask.value==""){alert("密码提示问题不能为空");document.form1.checkask.focus();returnfalse;}if(document.form1.checkans.value==""){alert("您的密码提示问题答案不能为空");document.form1.checkans.focus();returnfalse;}returntrue;}</script>js用户名与密码验证程序html代码 FTP帐号<inputname="ftpuser"type="text"class="formstyle"id="ftpuser"size="16">&nbsp;FTP密码<inputname="ftppass"type="password"class="formstyle"id="ftppass"size="16">&nbsp;验证码<inputname="randNum"type="text"class="formstyle1"id="randNum"size="8"maxlength="4">&nbsp;<imgheight="25"align="absmiddle"src="../user/verpic.net?1246063855&background=e9f0f7"><inputname="backpage"type="hidden"value="/vhost/index.net?type=index"><inputname="Submit"type="submit"class="buttonYinse"value="登陆"style="cursor:hand;">Javascript应用技巧把如下代码加入<body>区域中<FORMMETHOD="POST"><divalign=