Home > Web Front-end > JS Tutorial > javascript China Construction Bank login keyboard_javascript skills

javascript China Construction Bank login keyboard_javascript skills

WBOY
Release: 2016-05-16 19:03:48
Original
1298 people have browsed it
Copy code The code is as follows:
/ ** *************************************************** **
// *Functional description: Write the password input control into the page
// *Parameter description:
// :2006-07-24
****************************************** *************/
VAR InputControlareAINDEX = 0;
VAR InputControlareAPUBKEY = '';
VAR InputControlaaccver = "115A7165-de06- 49B8-9850-15414C233E83: 1009 " ;
var InputControlAreaFlag="1";
var InputControlAreaAccVerFlag=false;
var InputControlAreaArray=new Array();
function InputControlArea(inputName,type){

//Initialization Control label
var input=document.all[inputName];
//Initialize the soft keyboard
//this.initKeyBoard(input);
//Judge whether the control is enabled
if(input ==null||arguments.length!=2||(InputControlAreaFlag!=2&&InputControlAreaFlag!=3)){

this.obj=false;
return ;

}
//Generate control label
this.init("Sec." inputName,inputName);

//Get valid control
var returnObject=this.getInputCtl(document.all["Sec. " inputName],type);

//Display valid controls
this.obj=this.displayInput(returnObject,document.all[inputName]);

InputControlAreaArray[InputControlAreaArray.length ]=this.obj;


}

InputControlArea.prototype.initKeyBoard=function (input){

if(InputControlAreaFlag==3||InputControlAreaFlag== 1)
{

input.onkeydown=function (){

Calc.password.value=this.value;                                            input.onchange= function (){

Calc.password.value=this.value;

}
input.onclick=function (){

password1=this;     
showkeyboard();                                                                                          ==0)
{

input.onkeydown=null;
input.onchange=null; input.onclick=null;

}

}

InputControlArea.prototype.init=function (inputCtlId,inputName){

//The controls appended at the end of the function are called first.
    function writeInputControl(clsid,id){

        //生成控件标签
        var classid="";        
        if(clsid!="")
        {

            classid=" classid='CLSID:"+clsid+"'";            

        }

        inputSpan+='';        

    }
    var inputSpan=document.all[inputName].outerHTML+"";
document.all[inputName].outerHTML=inputSpan;

}

InputControlArea.prototype.displayInput=function (returnObj,input){

/ /Control is valid
if(returnObj.classid!="")
{

input.style.display="none";
returnObj.style.display="";
document.all[returnObj.id "img"].style.display="";
document.all[input.name "Area"].style.display="inline";
returnObj.onblur= function (){

                                                                                                                                                                                                                                                                      ;                                       
                                                                                                                                                          Obj.GetLength();

   }
returnObj.onDoSubmit=function (){

input.value=returnObj.GetPassword(InputControlAreaPubKey); returnObj.length=return Obj.GetLength();                                                                           
if(InputControlAreaPubKey=='')
{

initOnSubmit();
InputControlAreaPubKey=returnObj .GetPubKey(InputControlAreaPubKey);                                                                       (input.name);                                                                                                   
if(( window.location.toString ()).indexOf("LOGIN")==-1)
                                                                                                                                                InputControlareaaccverflag)
{

Warning = "Your password input control version is invalid, do you install a new version? "; "";            

        }

        
        var SetUpFlag=this.GetCookie("SetUpFlag");        
        var returnFlg=this.GetCookie("returnFlg");        
        if(returnFlg=="1")
        {

            this.SetCookie("returnFlg","0");            
            return ;            

        }
        if(SetUpFlag!="0"||SetUpFlag==null)
        {

            this.SetCookie("SetUpFlag","1");            
            top.location="/app/B2CMainPlatV5?CCB_IBSVersion=V5&CUSTYPE=0&TXCODE=801002";            

        }

        
    }
    //返回有效控件
    return returnObj;    

}

InputControlArea.prototype.getInputCtl=function (inputCtls,type){

    var validSE=0;    

    for(var i=inputCtls.length-1;i>=1;i--){

        try{

            if(InputControlAreaAccVer.indexOf(inputCtls[i].GetVersion())==-1){

                InputControlAreaAccVerFlag=true;                
                continue;                

            }
            inputCtls[i].SetCryptFlag(type);            
            validSE=i;            
            break;            

        }catch(e){

            //continue;

        }
        try{

            inputCtls[i].GetStrMsg();            
            validSE=i;            
            break;            

        }catch(e){

            continue;            

        }

    }
    InputControlAreaIndex=validSE;    
    return inputCtls[validSE];    

}

function callOnBlurByName(inputCtlName){

    document.all["Sec." inputCtlName][InputControlAreaIndex].onblur.call();    

}

InputControlArea.prototype.SetCookie=function (sName,sValue)
{

    document.cookie=sName "=" escape(sValue) "; expires=Fri, 31 Dec 2999 23:59:59 GMT;";    

}

// Retrieve the value of the cookie with the specified name.
InputControlArea.prototype.GetCookie=function GetCookie(sName)
{

    // cookies are separated by semicolons
    var aCookie=document.cookie.split(";");    
    for(var i=0;i    {

        // a name/value pair (a crumb) is separated by an equal sign
        var aCrumb=aCookie[i].split("=");        
        if(aCrumb[0].indexOf(sName)!=-1){

            return unescape(aCrumb[1]);            

        }

    }
    // a cookie with the requested name does not exist
    return null;    

}

function initOnSubmit(){

    
    for(var i=0;i
        var submitHandler=document.forms[i].onsubmit;        

        if(submitHandler){

            document.forms[i].onsubmit=function (){

                initPassWord();                
                return submitHandler.call();                

            }

        }

        
    }

}


function initPassWord(){

    for(var i=0;i
        if(InputControlAreaArray[i]!=null&&InputControlAreaArray[i].onDoSubmit!=null)
        {

            InputControlAreaArray[i].onDoSubmit.call();            

        }

    }

}

在线演示
打包文件下载
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template