<INPUT TYPE="button" value="Login" tabindex="4"> <INPUT TYPE="button" value="Register" tabindex="4"> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if((starts,starts+1)==" ") starts++; else break; } while(starts<ends) { if((ends-1,ends)==" ") ends--; else break; } return (starts,ends); } function isvalidcode(inputs) //Check the postal code { var i,temp; var isvalidcode = true; inputstr=trim(inputs); if(==null||==0||!=6) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!(temp>="0" && temp<="9")) { isvalidcode=false; break; } } return isvalidcode; } function isvalidtel(inputs) //Check the phone number { var i,temp; var isvalidtel = true; inputstr=trim(inputs); if(==null||==0) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!(temp>="0" && temp<="9" || temp=="-")) { isvalidtel=false; break; } } return isvalidtel; } function isrealnum(inputs) //Check real numbers (including decimal points) { var i,temp; var isrealnum = true; inputstr=trim(inputs); if(==null||==0) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!(temp>="0" && temp<="9" || temp==".")) { isrealnum=false; break; } } return isrealnum; } function isnumeric(inputs) //Check whether integers { var i,temp; var isnumeric = true; inputstr=trim(inputs); if(==null||==0) return false; //isvalid = true; for(i=0;i<;i++) { temp=(i,i+1); if(!(temp>="0" && temp<="9")) { isnumeric=false; break; } } return isnumeric; } function isvalidide(inputs) //Check ID card { var i,temp; var isvalidide = true; inputstr=trim(inputs); if( == null || == 0 || ( != 15 && != 18)) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!((temp>="0" && temp<="9") || temp == "x" || temp == "X")) { isvalidide=false; break; } } return isvalidide; } function isvalidname(inputs) //Check account 2~15 digits (that is, it can only be a string composed of English letters and numbers) { var i,temp; var isvalidname = true; inputstr=trim(inputs); if(==null || ==0 || > 15 || < 2) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!((temp >= "0" && temp <= "9") || (temp >= "a" && temp <= "z") || (temp >= "A" && temp <= "Z"))) { isvalidname=false; break; } } return isvalidname; } function isvalidphoto(inputs) //Check the photo extension { var i,temp; var isvalidphoto = true; inputstr=trim(inputs); if(==null || ==0) return true; //Accepts temp=((".")+1); temp = (); if(!(temp == "bmp" || temp == "jpg" || temp == "gif")) { isvalidphoto=false; } return isvalidphoto; } function isvalidzgh(inputs) //Check the employee number 8 digits (that is, it can only be a string composed of English letters and numbers) { var i,temp; var isvalidzgh = true; inputstr=trim(inputs); if(==null || ==0 || != 8) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!((temp >= "0" && temp <= "9") || (temp >= "a" && temp <= "z") || (temp >= "A" && temp <= "Z"))) { isvalidzgh=false; break; } } return isvalidzgh; } function isvalidxh(inputs) //Check the student number 7 digits (that is, it can only be a string composed of English letters and numbers) { var i,temp; var isvalidxh = true; inputstr=trim(inputs); if(==null || ==0 || != 7) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!((temp >= "0" && temp <= "9") || (temp >= "a" && temp <= "z") || (temp >= "A" && temp <= "Z"))) { isvalidxh=false; break; } } return isvalidxh; } function isvalidkcid(inputs) //Check the course number 5 digits (that is, it can only be a string composed of numbers) { var i,temp; var isvalidkcid = true; inputstr=trim(inputs); if(==null||==0||!=5) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!(temp>="0" && temp<="9")) { isvalidkcid=false; break; } } return isvalidkcid; } function isvalidnamee(inputs) //Check account 4~20 digits (that is, it can only be a string composed of English letters and numbers) { var i,temp; var isvalidname = true; inputstr=trim(inputs); if(==null || ==0 || > 20 || < 4) return false; for(i=0;i<;i++) { temp=(i,i+1); if(!((temp >= "0" && temp <= "9") || (temp >= "a" && temp <= "z") || (temp >= "A" && temp <= "Z"))) { isvalidname=false; break; } } return isvalidname; } ======================================= <Script language="JavaScript"> function login() { = trim(); = trim(); form1. = trim(form1.); = trim(); = trim(); if(!isvalidname()) { alert("Please note: the user name must be "2~15 digits English or numeric"!"); (); return false; } else if(!isvalidname()) { alert("Please note: the password must be "2~15 digits English or digit"!"); (); return false; } else if(!isvalidname(form1.)) { alert("Please note: the password confirmation must also be "2~15 digits English or digit"!"); form1.(); return false; } else if( != form1.) { alert("Two passwords are inconsistent!"); (); return false; } else if( == "" || > 100) { alert("Please enter email!"); (); return false; } else if( == "" || > 15) { alert("Please enter a nickname!"); (); return false; } else if((("You are sure to submit!")) return true; else return false; } function regedit() { var litop = ( - 162)/2; var lileft = ( - 360)/2; ("/", "reg", "titlebar=no,fullscreen=no,dependent=yes,height=162,width=360, top=" + litop + ",left=" + lileft + ", toolbar=no,menubar=no,scrollbars=no,resizable=no, channelmode=no,status=no,location=no,directories=no"); } </Script>
Previous page12345Next pageRead the full text