下面代码是一个登录页面,请问:
1、取消验证码
2、保存密码,自动登录;请高手指教,谢谢!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html ><head><TITLE>登录</TITLE><script type="text/javascript" src="http://resource.wzjqsj.cn/image/systemdata/sysmemberlogin/1.0/26/commonjs/commonfunction.js" ></script><script type="text/javascript" src="http://resource.wzjqsj.cn/image/systemdata/sysmemberlogin/1.0/26/commonjs/validator.js" ></script><script type="text/javascript" src="http://resource.wzjqsj.cn/image/systemdata/sysmemberlogin/1.0/26/script/popiframe.js" ></script><!--<link href="http://resource.wzjqsj.cn/image/systemData/sysmemberlogin/1.0/26/style/PopIframe.css" rel="stylesheet" type="text/css" />
    <link href="http://resource.wzjqsj.cn/image/systemData/sysmemberlogin/1.0/26/style/LoginStyle.css" rel="stylesheet" type="text/css" />--><LINK rel=stylesheet type=text/css href="http://resource.uninforun.com/image/2419/1/239/lfgjjg/style.css" ></head><body><DIV>
<TABLE style="HEIGHT: 30px" class=middletable >
<TBODY>
<TR>
<TD></TD><TD style="COLOR: red" align=middle ><et:var parameter="errorinfo" source="page" name="err" /><et:if c="err!=''"><et:echo parameter="errorinfo" source="page" format="<span style='color:#505050'>登录失败:</span>{0}" /></et:if></TD></TR></TBODY></TABLE>
<DIV class=loginTop></DIV>
<DIV class=loginMid>
<DIV class=userDiv>
<DIV class=userTop></DIV>
<DIV class=userMid><et:form id=frm_login type="user" dllname="Eshr.Member" savemethod="Eshr.Member.Web.MemberLogin.SsoLogin" callback="window.parent.window.LocalCallBack('{0}')" target="ifm">
<UL class=userUl>
<LI>用户名 <INPUT id=username class=loginInput01 maxLength=30 name=username> </LI><LI>密&nbsp;&nbsp;&nbsp;码 <INPUT id=password class=loginInput01 maxLength=30 type=password name=password> </LI><LI>验证码 <INPUT id=vcode class=loginInput02 maxLength=30 name=vcode autocomplete="off"> <IMG style="BORDER-BOTTOM: #ffcc00 1px solid; BORDER-LEFT: #ffcc00 1px solid; BORDER-TOP: #ffcc00 1px solid; CURSOR: pointer; BORDER-RIGHT: #ffcc00 1px solid" id=imgVcode onclick=change_verify(); alt=图片看不清?点击重新得到验证码 align=absMiddle src="<et:echo source='Settings' parameter='IMAGESERVER' />" > </LI><LI><A class=lista href="findpass/RecoverPasswd.aspx">忘了密码?</A> <A onclick=LocalSubmit() href="#"><IMG border=0 src="http://resource.uninforun.com/image/2419/1/239/loginbutton.gif" width=40 height=22 ></A><A href="#"><IMG border=0 src="http://resource.uninforun.com/image/2419/1/239/resultbutton.gif" width=41 height=22 ></A> </LI></UL><et:var source="page" name="p" param="ca" /><et:if c="string(p)=''"><et:var source="value" name="p" param="../default.aspx" /></et:if><INPUT value="<et:echo source='variable' param='p' />" type=hidden name=TRUN_PAGE> <%--<et:textbox type="hidden" field="TRUN_PAGE" source="page" parameter="trunPage" />--%><INPUT id=hid_sitepkid value="<et:echo source='Settings' parameter='SSOSITEID' />" type=hidden name=hid_sitepkid> </et:form><TABLE style="DISPLAY: none" id=divIncoming >
<TBODY>
<TR><TD colSpan=2 >您好:<et:echo parameter="MemberName" source="Session" /></TD></TR>
<TR>
<TD>登录时间:</TD>
<TD>
<DIV id=LoginTime></DIV></TD></TR>
<TR><TD style="COLOR: #3d3d3d" width=170 colSpan=2 align=left >注:退出时请按"注销"按钮,否则不能安全退出。 <SPAN style="COLOR: red">为保证信息安全,请定期更换密码。</SPAN></TD></TR>
<TR><TD colSpan=2 ><A onclick=DoLogout(); href="#">注销</A></TD></TR></TBODY></TABLE></DIV>
<DIV class=userFoot></DIV></DIV></DIV>
<DIV class=loginFoot></DIV><IFRAME style="DISPLAY: none" id=ifm height=500 width="100%" name=ifm></IFRAME></DIV><script type="text/javascript" >
    function change_verify(){
         var url =  "<et:echo source='Settings' parameter='IMAGESERVER' />"+"?tmp="+Math.random();
         document.all.imgVcode.src=url;
    }
    
    function cleanVerify(){
        document.getElementById("vcode").value="";
    }
    
    
    /* 登录部分提交数据*/   
    function LocalSubmit(){
        document.getElementsByName("__DLL")[0].value = "Eshr.Member";
        document.getElementsByName("__CALLBACK")[0].value = "window.parent.window.LocalCallBack('{0}')";
document.getElementsByName("__METHOD")[0].value = "Eshr.Member.Web.MemberLogin.SsoLogin";
        document.forms["frm_login"].submit();
    }
    
    
    function LocalCallBack(info){
        if(Validate())
        {     
            var array = info.split("|");
            $F("frm_login").action = array[0];
            document.forms["frm_login"].target = "_self";    
            document.forms["frm_login"].submit();   
        }  
    }
    
    window.attachEvent("onload", 
    function(){
    
        if(document.getElementById("vcode") != null){
            document.getElementById("vcode").style.color = "#999999";  
            document.getElementById("vcode").onfocus = function(){
               cleanVerify();
            }
        }
        
        //判断是否已经有本地session
        var uid = "<et:echo source='Session' parameter='UserName' />"; 
        if(uid != ""){
            document.forms["frm_login"].style.display = "none";
            document.getElementById("divIncoming").style.display = "";
        }
                
        var year,month,day,hours,minutes,seconds,ap;
        var intYear,intMonth,intDay,intHours,intMinutes,intSeconds;
        var today;
        today=new Date();
        intYear=today.getYear();
        intMonth=today.getMonth()+1;
        intDay=today.getDate();
        intHours=today.getHours();
        intMinutes=today.getMinutes();
        intSeconds=today.getSeconds();
        //获取系统时间的小时数
        if(intHours==0)
        {
        hours=intHours+":";
        ap="凌晨";
        }
        else if(intHours<12)
        {
        hours=intHours+":";
        ap="早晨";
        }
        else if(intHours==12)
        {
        hours=intHours+":";
        ap="中午";
        }
        else
        {
        intHours=intHours-12;
        hours=intHours+":";
        ap="下午";
        }
        //获取系统时间的分数
        if(intMinutes<10)
        {
        minutes="0"+intMinutes;
        }
        else
        minutes=intMinutes;
        //获取系统时间的秒数
        if(intSeconds<10)
        seconds="0"+intSeconds+" ";
        else
        seconds=intSeconds+" ";
        timeString=intYear+"年"+intMonth+"月"+intDay+"日 "+hours+minutes+" "+ap;
        document.all["LoginTime"].innerHTML = timeString;
    });
    
    function reset(){
        document.getElementById("username").value = "";
        document.getElementById("password").value = "";
    }
        
    function Validate(){
        var bool = false;
        bool = RequiredValidator("username", "", "请输入登录名", true);
        bool = bool &&  RequiredValidator("password", "", "请输入用户密码", true);
        bool = bool &&  RequiredValidator("vcode", "", "请输入验证码", true);
        return bool;
    }
    
    function DoLogout(){
        var ifm   =  $C("iframe");
        ifm.src="DoLogOut.aspx";
        document.body.appendChild(ifm);  
        ifm.style.width= "100%"; 
        ifm.style.display = "none";
        var ifram   =   document.frames[0];  
        PopIframeOpen('', 'Wait.aspx',280, 120); 
     }
    </script></body></html>

解决方案 »

  1.   

    <LI>验证码 <INPUT id=vcode class=loginInput02 maxLength=30 name=vcode autocomplete="off"> <IMG style="BORDER-BOTTOM: #ffcc00 1px solid; BORDER-LEFT: #ffcc00 1px solid; BORDER-TOP: #ffcc00 1px solid; CURSOR: pointer; BORDER-RIGHT: #ffcc00 1px solid" id=imgVcode onclick=change_verify(); alt=图片看不清?点击重新得到验证码 align=absMiddle src="<et:echo source='Settings' parameter='IMAGESERVER' />" > </LI>这段代码就是验证码的你再去取消掉和它相关的操作方法就行了
      

  2.   

     bool = bool && RequiredValidator("vcode", "", "请输入验证码", true);
    还有这行,具体看你那执行到了还有啥问题,
    这个有可能还有后台, 后台有些会先判断验证码是否正确再去验证用户名的wan
      

  3.   

    在首次登陆成功之后,将输入的用户名和密码写进cookie,在登陆前部先判断是否存在cookie,存在则直接跳过输入用户名密码,不存在则要求输入用户名密码