一直在做项目,天天忙到深夜,最近稍有空闲,写了个通用js脚本,如果在项目中应用的话,可能会减少不少页面缺陷。脚本大致包括几个方面:
1、通用校验方法:可以设定若干通用类型(如数字、金额、文本等),根据特定类型自动校验、统一提示信息、自动对齐、自动设置长度等。
2、自动获取页面初始焦点和回车切换焦点
3、通用关联日期的计算方法(根据某个日期计算若干期间后的新日期)
4、页面div拖拽方法
以下附有测试文件,可供参考:
- <HTML>
- <head>
- <style>
- body{font-family:Verdana;font-size:11px;color:#333;}
- #win1{[position:absolute;left:100;top:100;width:50px;height:50px;border:1px solid #000;}
- .title{width:100%;height:18px;color:#fff;cursor:hand;}
- </style>
- <SCRIPT language="javascript">
- var move=false;
- function StartDrag(obj)
- {
- if(event.button==1&&event.srcElement.tagName.toUpperCase()=="DIV")
- {
- obj.setCapture();
- obj.style.background="#999";
- move=true;
- }
- }
- function Drag(obj)
- {
- if(move)
- {
- var oldwin=obj.parentNode;
- oldwin.style.left=event.clientX-50;
- oldwin.style.top=event.clientY-10;
- }
- }
- function StopDrag(obj)
- {
- obj.style.background="";
- obj.releaseCapture();
- move=false;
- }
- /**
- * 通用单输入框校验方法
- * @param ids 输入框的id值,同时也是提示信息中输入框的名称
- * @param type 校验方式
- */
- function checkValid(ids,type)
- {
- var tempid;
- tempid= document.getElementById(ids);
- var values=Trim(tempid.value);
- if (values=='')
- return;
- tempid.value=values;
- if ((type=='amt') || (type=='int') || (type=='float') || (type=='positive'))
- {
- //去掉前置的0
- var temp='';
- for (i=0;i<values.length-1 ;i++)
- {
- if ((values.charAt(i)=='0') && (values.charAt(i+1)!='.') && (temp==''))
- {
- }
- else
- temptemp=temp+values.charAt(i);
- }
- values=temp+values.charAt(i);
- tempid.value=values;
- }
- if (type=='amt')
- {
- if (checkAmount(values,ids))
- {
- tempid.value=formatAmount(reverseFormatAmount(values));
- }
- return;
- }
- if (type=='int')
- {
- if (!isInt(values) || (values.substring(0,2)=='-0') || (values=='-'))
- {
- alert("/""+ids+"/""+"应该为整数,请重新录入" );
- tempid.select();
- }
- return;
- }
- if (type=='positive')
- {
- if ((!isInt(values)) || (values<=0) || (values== '-'))
- {
- alert("/""+ids+"/""+"应该为正整数,请重新录入" );
- tempid.select();
- }
- return;
- }
- if (type=='float')
- {
- if (!isFloat(values) || (values=='.') || (values=='-'))
- {
- alert("/""+ids+"/""+"应该为数值,请重新录入" );
- tempid.select();
- return;
- }
- for (i=0;i<values.length ;i++ )
- {
- if (values.charAt(i)==',')
- {
- alert("/""+ids+"/""+"应该为数值,请重新录入" );
- tempid.select();
- break;
- }
- }
- if (values.charAt(0)=='.')
- {
- values='0'+values;
- tempid.value=values;
- }
- if (values.charAt(values.length-1)=='.')
- {
- valuesvalues=values.substring(0,values.length-1);
- tempid.value=values;
- }
- return;
- }
- if (type=='date')
- {
- if (!isDate(values))
- {
- alert("/""+ids+"/""+"应该为日期格式,请重新录入" );
- tempid.select();
- }
- return;
- }
- if (type=='email')
- {
- if (!isEmail(values))
- {
- alert("/""+ids+"/""+"不是有效的电子邮件格式,请重新录入" );
- tempid.select();
- }
- return;
- }
- if (type=='fax')
- {
- if (!isFax(values))
- {
- alert("/""+ids+"/""+"不是有效的传真格式,请重新录入" );
- tempid.select();
- }
- return;
- }
- if (type=='norm')
- {
- if (!isNorm(values))
- {
- alert("/""+ids+"/""+"含有特殊字符,请重新录入" );
- tempid.select();
- }
- return;
- }
- if (type=='need')
- {
- if (isNeed(values))
- {
- alert("/""+ids+"/""+"不能为空,请重新录入" );
- tempid.select();
- }
- return;
- }
- }
- /**
- * 校验金额
- * @param d_input 需要校验的输入框的值
- * @param d_str 提示信息中输入框的名称
- */
- function checkAmount(d_input,d_str)
- {
- var id = document.getElementById(d_str);
- if (!isFloat(reverseFormatAmount(d_input)) || (d_input=="-") || (d_input=="."))
- {
- alert("/""+d_str+"/""+"应该为数值,请重新录入" );
- id.select();
- return (false);
- }
- if (reverseFormatAmount(d_input) < 0.01)
- {
- alert("/""+d_str+"/""+"的值应该大于0" );
- id.select();
- return (false);
- }
- if (reverseFormatAmount(d_input) > 1000000000000 )
- {
- alert("/""+d_str+"/""+"的值应该小于1,000,000,000,000" );
- id.select();
- return (false);
- }
- return true;
- }
- /**
- * 反向格式化金额
- * @param strData 需要格式化的数据
- * @return 返回反格式化的金额
- */
- function reverseFormatAmount (strData)
- {
- var i,strTemp;
- //去掉所有的","
- strTemp=new String(strData);
- strData="";
- for(i=0;i<strTemp.length;i++)
- {
- var cData;
- cData=strTemp.charAt(i);
- if (cData!=",")
- {
- strDatastrData=strData+cData;
- }
- }
- return strData;
- }
- /**
- * 格式化金额
- * @param strData 需要格式化的数据
- * @return 返回格式化的金额
- */
- function formatAmount(strData)
- {
- if(isInnerFloat(strData))
- {
- if(strData!="")
- {
- var i,strTemp;
- //去掉所有的","
- strTemp=new String(strData);
- strData="";
- if (strTemp.charAt(0)==".")
- strTemp="0"+strTemp;
- for(i=0;i<strTemp.length;i++)
- {
- var cData;
- cData=strTemp.charAt(i);
- if (cData!=",")
- {
- strDatastrData=strData+cData;
- }
- }
- //将小数点前和后的数据分别取出来
- var nPoint;
- nPoint=strData.indexOf(".");
- var strFront=strData,strEnd="";
- if(nPoint!=-1)
- {
- strFront=strData.substring(0,nPoint);
- strEnd=strData.substring(nPoint+1,strData.length);
- }
- //小数点前面的数据加","
- strTemp=new String(strFront);
- var bHaveMinus=false;
- if(strFront.substring(0,1)=="-")
- {
- bHaveMinus=true;
- strTempstrTemp=strTemp.substring(1,strTemp.length);
- }
- strFront="";
- var nNum;
- nNum=0;
- for(i=strTemp.length-1;i>=0;i--)
- {
- if(nNum==3)
- {
- strFront=","+strFront ;
- nNum=0;
- }
- nNum++;
- var cData;
- cData=strTemp.charAt(i);
- strFront=cData+strFront;
- }
- if(bHaveMinus)
- {
- strFront="-" + strFront;
- }
- //补或者截小数点后面的值,保持两位
- if(strEnd.length>2)
- {
- strEndstrEnd=strEnd.substring(0,2);
- }
- else
- {
- if(strEnd.length==1)
- {
- strEndstrEnd=strEnd+ "0";
- }
- else
- {
- if(strEnd.length==0)
- {
- strEnd="00";
- }
- }
- }
- strData=strFront+"." + strEnd;
- }
- }
- return strData;
- }
- /**
- * 是否是float型
- * @param strData 需要校验的数据
- * @return 返回检验结果
- */
- function isInnerFloat( d_float)
- {
- if(isNaN(parseFloat(d_float)))
- return false;
- else
- return true;
- }
- /**
- * 是否是浮点型
- * @param d_float 需要校验的数据
- * @return 返回检验结果
- */
- function isFloat( d_float)
- {
- var checkOK = "0123456789-,.";
- var checkStr = d_float;
- var allValid = true;
- var decPoints = 0;
- var allNum = "";
- for (i = 0; i < checkStr.length; i++)
- {
- ch = checkStr.charAt(i);
- for (j = 0; j < checkOK.length; j++)
- if (ch == checkOK.charAt(j))
- break;
- if (j == checkOK.length)
- {
- allValid = false;
- break;
- }
- if ( (ch == '-') && (i!=0) )
- {
- allValid = false;
- break;
- }
- if (ch != ",")
- allNum += ch;
- if (ch == ".")
- decPoints += 1;
- }
- if ( decPoints > 1 )
- {
- allValid = false;
- }
- return (allValid)
- }
- /**
- * 校验是否Int整型类型
- *
- */
- function isInt( d_int)
- {
- var checkOK = "0123456789-";
- var checkStr = d_int;
- var allValid = true;
- var decPoints = 0;
- var allNum = "";
- for (i = 0; i < checkStr.length; i++)
- {
- ch = checkStr.charAt(i);
- if ((i>0) && (ch=='-'))
- {
- allValid = false;
- break;
- }
- for (j = 0; j < checkOK.length; j++)
- {
- if (ch == checkOK.charAt(j))
- {
- break;
- }
- }
- if (j == checkOK.length)
- {
- allValid = false;
- break;
- }
- if (ch != ",")
- {
- allNum += ch;
- }
- }
- return (allValid)
- }
- /**
- * 校验Email
- */
- function isEmail( d_email)
- {
- var checkStr = d_email;
- var emailtag = false;
- var emaildot=0;
- var emailat=0;
- var atseq=0;
- var dotseq=0;
- if (checkStr.length<7) return (false);
- for (i = 0; i < checkStr.length; i++)
- {
- ch = checkStr.charAt(i);
- if (ch=='@') {emailat++; atseq=i;}
- if (ch=='.') {emaildot++; dotseq=i;}
- }
- if (( emailat==1 ) && (emaildot==1) && (atseq>0) && (dotseq>atseq+1) )
- {
- emailtag = true;
- }
- return (emailtag);
- }
- /**
- * 校验传真
- */
- function isFax( d_int)
- {
- var checkOK = "0123456789 -()";
- var checkStr = d_int;
- var allValid = true;
- var decPoints = 0;
- var allNum = "";
- for (i = 0; i < checkStr.length; i++)
- {
- ch = checkStr.charAt(i);
- for (j = 0; j < checkOK.length; j++)
- if (ch == checkOK.charAt(j))
- break;
- if (j == checkOK.length)
- {
- allValid = false;
- break;
- }
- if (ch != ",");
- allNum += ch;
- }
- return (allValid)
- }
- /**
- * 校验特殊字符
- */
- function isNorm(d_string )
- {
- var i;
- var specialChar = "%&*_|<>'";
- var allValid = false;
- for (i = 0; i < d_string.length; i++)
- {
- var c = d_string.charAt(i);
- if (specialChar.indexOf(c) >= 0) allValid = true;
- }
- return (!allValid);
- }
- /**
- * 校验必输项
- */
- function isNeed( temp )
- {
- if (temp== '')
- return true;
- else
- return false;
- }
- /*
- ==================================================================
- LTrim(string):去除左边的空格
- ==================================================================
- */
- function LTrim(str)
- {
- var whitespace = new String(" /t/n/r");
- var s = new String(str);
- if (whitespace.indexOf(s.charAt(0)) != -1)
- {
- var j=0, i = s.length;
- while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
- {
- j++;
- }
- ss = s.substring(j, i);
- }
- return s;
- }
- /*
- ==================================================================
- RTrim(string):去除右边的空格
- ==================================================================
- */
- function RTrim(str)
- {
- var whitespace = new String(" /t/n/r");
- var s = new String(str);
- if (whitespace.indexOf(s.charAt(s.length-1)) != -1)
- {
- var i = s.length - 1;
- while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
- {
- i--;
- }
- ss = s.substring(0, i+1);
- }
- return s;
- }
- /*
- ==================================================================
- Trim(string):去除前后空格
- ==================================================================
- */
- function Trim(str)
- {
- return RTrim(LTrim(str));
- }
- /**
- * 校验日期
- */
- function isDate(datestr)
- {
- var lthdatestr
- if (datestr != "")
- lthdatestr= datestr.length ;
- else
- lthdatestr=0;
- var tmpy="";
- var tmpm="";
- var tmpd="";
- var status;
- status=0;
- if ( lthdatestr== 0)
- return 0
- for (i=0;i<lthdatestr;i++)
- { if (datestr.charAt(i)== '-')
- {
- status++;
- }
- if (status>2)
- {
- return 0;
- }
- if ((status==0) && (datestr.charAt(i)!='-'))
- {
- tmpytmpy=tmpy+datestr.charAt(i)
- }
- if ((status==1) && (datestr.charAt(i)!='-'))
- {
- tmpmtmpm=tmpm+datestr.charAt(i)
- }
- if ((status==2) && (datestr.charAt(i)!='-'))
- {
- tmpdtmpd=tmpd+datestr.charAt(i)
- }
- }
- year=new String (tmpy);
- month=new String (tmpm);
- day=new String (tmpd)
- if ((tmpy.length!=4) || (tmpm.length>2) || (tmpd.length>2))
- {
- return 0;
- }
- if (!((1<=month) && (12>=month) && (31>=day) && (1<=day)) )
- {
- return 0;
- }
- if (!((year % 4)==0) && (month==2) && (day==29))
- {
- return 0;
- }
- if ((month<=7) && ((month % 2)==0) && (day>=31))
- {
- return 0;
- }
- if ((month>=8) && ((month % 2)==1) && (day>=31))
- {
- return 0;
- }
- if ((month==2) && (day==30))
- {
- return 0;
- }
- return 1;
- }
- /**
- * 通用模式化输入框的方法
- */
- function setClass()
- {
- var alls =document.getElementsByTagName("input");
- var temp;
- for (i=0;i<alls.length ;i++ )
- {
- temp=alls[i];
- if (temp.getAttribute("name").substring(0,3)=="txt")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",50);
- temp.style.textAlign="left";
- }
- if (temp.getAttribute("name").substring(0,3)=="num")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",20);
- temp.style.textAlign="left";
- }
- if (temp.getAttribute("name").substring(0,3)=="amt")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",15);
- temp.style.textAlign="right";
- }
- if (temp.getAttribute("name").substring(0,3)=="dat")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",20);
- temp.style.textAlign="left";
- }
- if (temp.getAttribute("name").substring(0,3)=="int")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",20);
- temp.style.textAlign="left";
- }
- if (temp.getAttribute("name").substring(0,3)=="pos")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",20);
- temp.style.textAlign="left";
- }
- if (temp.getAttribute("name").substring(0,3)=="ema")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",20);
- temp.style.textAlign="left";
- }
- if (temp.getAttribute("name").substring(0,3)=="fax")
- {
- temp.setAttribute("size",20);
- temp.setAttribute("maxLength",20);
- temp.style.textAlign="left";
- }
- }
- setFocus();
- }
- function check (obj)
- {
- var temp=obj;
- var ids=temp.id;
- var values=temp.value;
- var type=temp.name.substring(0,3);
- if (type=='txt')
- {
- type='norm';
- }
- if (type=='num')
- {
- type='float';
- }
- if (type=='dat')
- {
- type='date';
- }
- if (type=='pos')
- {
- type='positive';
- }
- if (type=='ema')
- {
- type='email';
- }
- checkValid(ids,type);
- }
- function setFocus()
- {
- //页面初始焦点
- for(var i= 0; i < document.all.length; i++)
- {
- if ((document.all[i].tagName == "INPUT") && (!document.all[i].readOnly) && (!document.all[i].disabled))
- {
- document.all[i].focus();
- break;
- }
- }
- }
- //回车键切换焦点
- function document.onkeydown()
- {
- var e = event.srcElement;
- if (event.keyCode == 13)
- {
- if (e.tagName == "INPUT" && e.type != "button" && e.type != "textarea")
- {
- //find the next input;
- for(var i= e.sourceIndex+1; i < document.all.length; i++)
- {
- if (document.all[i].tagName == "INPUT" && document.all[i].type != "textarea" && (!document.all[i].readOnly) && (!document.all[i].disabled))
- {
- document.all[i].focus();
- break;
- }
- }
- }
- }
- }
- function getDateBy(obj,type,method,period)
- {
- var tempDate=createDate(obj,type); //根据变量获取日期
- if (method=='nextday')
- {
- return dateAdd('d', tempDate ,period);
- }
- else if (method=='nextmonth')
- {
- return dateAdd('m', tempDate ,period);
- }
- else if (method=='nextweek')
- {
- return dateAdd('w', tempDate ,period);
- }
- else if (method=='weekend')
- {
- return getWeekend(tempDate,period);
- }
- else if (method=='monthend')
- {
- return getMonthend(tempDate,period);
- }
- else if (method=='friday')
- {
- return getFriday(tempDate,period);
- }
- else if (method=='weekstart')
- {
- return getWeekstart(tempDate,period);
- }
- else if (method=='monthstart')
- {
- return getMonthstart(tempDate,period);
- }
- }
- function createDate(obj,type)
- {
- var temp;
- if (type=='id')
- {
- temp = document.getElementById(obj).value;
- return strToDate(temp); //字符串转日期
- }
- else if (type=='str')
- {
- return strToDate(obj);
- }
- else
- return obj;
- }
- function strToDate(DateStr)
- {
- var converted = Date.parse(DateStr);
- var myDate = new Date(converted);
- if (isNaN(myDate))
- {
- var arys= DateStr.split('-');
- myDate = new Date(arys[0],--arys[1],arys[2]);
- }
- return myDate;
- }
- function dateAdd(type, dtTmp ,Number)
- {
- var temp;
- switch (type) {
- case 'd' :temp = new Date(Date.parse(dtTmp) + (86400000*Number));
- break;
- case 'w' :temp = new Date(Date.parse(dtTmp) + ((86400000*7)*Number));
- break;
- case 'm' :
- temp = new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number, dtTmp.getDate());
- var year= temp.getFullYear(); //获取年份
- var month= temp.getMonth()+1; //获取月份
- var date= temp.getDate(); //获取日期
- if (dtTmp.getDate()!=date)
- {
- monthmonth=month-1;
- if (month<=0)
- {
- month=12;
- yearyear=year-1;
- }
- date=getDaysOfMonth(year,month);
- }
- return year+"-"+month+"-"+date;
- }
- var year= temp.getFullYear(); //获取年份
- var month= temp.getMonth()+1; //获取月份
- var date= temp.getDate(); //获取日期
- return year+"-"+month+"-"+date;
- }
- function getWeekend(temp,period)
- {
- if (temp.getDay()==0) //正好是周末
- {
- temp= strToDate(dateAdd('w',temp,period-1));
- }
- else
- temp= strToDate(dateAdd('w',temp,period));
- var year= temp.getFullYear(); //获取年份
- var month= temp.getMonth()+1; //获取月份
- var date= temp.getDate(); //获取日期
- var day= temp.getDay(); //获取星期几
- var daysOfMonth=getDaysOfMonth(year,month); //获取当月的天数
- var tempDates=date-day+7;
- if (tempDates>daysOfMonth)
- {
- if (month==12)
- {
- yearyear=year+1;
- month=1;
- }
- else
- {
- monthmonth=month+1;
- }
- date=tempDates-daysOfMonth;
- }
- else
- {
- date=tempDates;
- }
- return year+"-"+month+"-"+date;
- }
- function getDaysOfMonth(year,month)
- {
- var length;
- switch(month)
- {
- case 1:
- case 3:
- case 5:
- case 7:
- case 8:
- case 10:
- case 12:
- length=31;
- break;
- case 4:
- case 6:
- case 9:
- case 11:
- length=30;
- break;
- case 2:
- if((year%4==0)&&(year%100!=0)||(year%400==0))
- length=29;
- else
- length=28;
- }
- return length;
- }
- function getMonthend(temp,period)
- {
- temp= strToDate(dateAdd('m',temp,period));
- var year= temp.getFullYear(); //获取年份
- var month= temp.getMonth()+1; //获取月份
- var date= temp.getDate(); //获取日期
- var daysOfMonth=getDaysOfMonth(year,month); //获取当月的天数
- return year+"-"+month+"-"+daysOfMonth;
- }
- function getFriday(temp,period)
- {
- temp=strToDate(getWeekend(temp,period));
- temp= strToDate(dateAdd('d',temp,-2));
- var year= temp.getFullYear(); //获取年份
- var month= temp.getMonth()+1; //获取月份
- var date= temp.getDate(); //获取日期
- return year+"-"+month+"-"+date;
- }
- function getWeekstart(temp,period)
- {
- temp=strToDate(getWeekend(temp,period));
- temp= strToDate(dateAdd('d',temp,-6));
- var year= temp.getFullYear(); //获取年份
- var month= temp.getMonth()+1; //获取月份
- var date= temp.getDate(); //获取日期
- return year+"-"+month+"-"+date;
- }
- function getMonthstart(temp,period)
- {
- temp= strToDate(dateAdd('m',temp,period));
- var year= temp.getFullYear(); //获取年份
- var month= temp.getMonth()+1; //获取月份
- var date= temp.getDate(); //获取日期
- return year+"-"+month+"-01";
- }
- function tellmedate(temp)
- {
- alert('明天是:'+getDateBy(temp,'date','nextday',1));
- alert('1000天以后是:'+getDateBy(temp,'date','nextday',1000));
- alert('本周末是:'+getDateBy(temp,'date','weekend',0));
- alert('下周一是:'+getDateBy(temp,'date','weekstart',1));
- }
- function hide()
- {
- var temp=document.getElementById('win1');
- temp.style.visibility ='hidden';
- }
- function show()
- {
- var temp=document.getElementById('win1');
- temp.style.visibility ='visible';
- setFocus();
- }
- function turn()
- {
- for(var i= 0; i < document.all.length; i++)
- {
- if ((document.all[i].tagName == "INPUT") && (document.all[i].type == "text"))
- {
- document.all[i].value=reverse(document.all[i].value);
- }
- }
- }
- function reverse(str){ return str.length>1?reverse(str.substring(1))+str.charAt(0):str;}
- </SCRIPT>
- </head>
- <body onload="setClass();">
- <form method="post" name = "form1" action="" ENCTYPE="multipart/form-data" >
- <div id="win1">
- <div class="title" onMousedown="StartDrag(this)" onMouseup="StopDrag(this)" onMousemove="Drag(this)" ></div>
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <table border="0" width="98%" bgcolor="#0099CC" cellspacing="1" cellpadding="0" align="center">
- <tr>
- <td width="100%" colspan="6" height="19" class="FormTitle"><b>开户申请-新增</b></td>
- </tr>
- <tr>
- <td width="100%" bgcolor="#EFEFEF" align="right">
- <table border="0" width="100%" cellspacing="1" >
- <tr>
- <td height="25"> 测试普通文本:</td>
- <td align="left" nowrap> <input type="text" name="txtapplyerName" class="box" id="普通文本" value="" onblur="check(this);" ></td>
- <td></td>
- <td></td>
- </tr>
- </table>
- <hr>
- <table border="0" width="100%" cellspacing="1" >
- <tr>
- <td height="25" width="18%" nowrap> 测试普通数字:</td>
- <td align="left" width="32%" nowrap><font color=red>*</font> <input type="text" id="普通数字" name="numbelongOrgCode"value="" onblur="check(this);" >
- </td>
- <td height="25" width="18%" nowrap> 测试金额:</td>
- <td align="left" width="32%" nowrap> <input type="text" name="amtbelongOrgName" id="金额" value="" onblur="check(this);" ></td>
- </tr>
- <tr>
- <td height="25" width="18%" nowrap> 测试普通日期:</td>
- <td align="left" width="32%" nowrap><font color=red>*</font> <input type="text" id="普通日期" name="datbankCode" class="box" value="" onblur="check (this);" >
- </td>
- <td height="25" width="18%" nowrap> 测试整数:</td>
- <td align="left" width="32%" nowrap> <input type="text" name="intbankName" class="box" value="" id="整数" onblur="check (this);"></td>
- </tr>
- </table>
- <hr>
- <hr>
- <table border="0" width="100%" cellspacing="1" >
- <tr>
- <td width="18%" nowrap> 测试正整数:</td>
- <td width="32%" nowrap>
- <input id="正整数" name="posaccountProperty1Name" type="text" class="box" value="" onblur="check (this);">
- </td>
- <td width="18%" nowrap> 测试电子邮件:</td>
- <td width="32%" nowrap>
- <input id="电子邮件" name="emaaccountProperty2Name" type="text" class="box" value="" onblur="check (this);" >
- </td>
- </tr>
- <tr>
- <td width="18%" nowrap> 测试传真:</td>
- <td width="32%" nowrap>
- <input id="传真" name="faxaccountProperty2Name" type="text" class="box" value="" onblur="check (this);" >
- </td>
- </tr>
- <tr>
- <td colspan="4" width="82%" height="30" align="right" nowrap>
- <input type="button" value=" 逆 转 " name="eeee" class="button" onclick="turn();">
- <input type="button" value=" 查看日期 " name="eeee2" class="button" onClick="tellmedate(new Date());">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table></div>
- <input type="button" value=" 隐 藏 " name="save" class="button" onClick="hide();">
- <input type="button" value=" 显 示 " name="bk" class="button" onClick="show();">
- </form>
- </body>
- </html>