控件function rlCtrl()
{
// DateCtrl created by yyc 2000-6-18
// Copyright (C) 2000.6 yyc, All Rights Reserved
// this is a free class,but you must be reserve this comments
// E-mail:yycmail263.net
var varMe,s,d,i;
var len= rlCtrl.arguments.length;
if (len>0)
{
varMe=rlCtrl.arguments[0];
this.name=varMe;
if (len>=4)
{
this.year=rlCtrl.arguments[1];
this.month=rlCtrl.arguments[2];
this.day=rlCtrl.arguments[3];
}
else
{
today=new Date();
this.year=today.getYear();
this.month=today.getMonth()+1;
this.day=today.getDate();
}
this.getdate=getCurDate;
document.writeln('<TABLE width=160px border=0 cellPadding=0 cellSpacing=0>');
document.writeln('<TR><td>');
d=new Date(this.year,this.month-1,this.day);
i=d.getDay();
s=getsweek(i);
s=this.year+"年"+this.month+"月"+this.day+"日--"+s
document.writeln('<INPUT id=txt'+varMe+' name=txt'+varMe+' ondblclick=\'opencls('+varMe+');\' 9pt; FONT-STYLE: normal; HEIGHT: 20px; width:100%" value='+s+' readonly ></TD>');
document.writeln('<TD width=15px>');
document.writeln('<input type=button onclick=\'opencls('+varMe+');\' cursor:hand;FONT-SIZE: 8pt; FONT-STYLE: normal;" value="▼">');
document.writeln('</TD></TR>');
document.writeln("</table>");
document.writeln('<div id=div'+varMe+' name =div'+varMe+' POSITION:absolute;display:none; WIDTH: 160px">');
document.writeln('<TABLE id=tbl'+varMe+' name=tbl'+varMe+' WIDTH=100% BGCOLOR=#c0c0c0 onkeyup=\'doKey('+varMe+',window.event.keyCode) \' ALIGN=center blue; FONT-SIZE: 9pt;" BORDER=1 CELLSPACING=1 CELLPADDING=1>');
document.writeln("<TR><TD colspan=7>");
document.writeln('<INPUT id=year'+varMe+' name=year'+varMe+' value='+this.year+' BORDER-BOTTOM: green 0px solid;BORDER-LEFT: green 0px solid;BORDER-RIGHT: green 0px solid; BORDER-TOP: green 0px solid;COLOR: blue;CURSOR: hand; FONT-SIZE: 10pt; HEIGHT: 15px; MARGIN-TOP: 0pt; WIDTH: 35px" ');
document.writeln('onmousemove =\'javascript:if (this.readOnly) {this.style.backgroundColor=0xffffff; this.style.borderWidth=1;} \'');
document.writeln('onmouseout =\'javascript: if (this.readOnly) { this.style.backgroundColor ="transparent";this.style.borderWidth=0;} \' ');
document.writeln('onclick=\'javascript: this.style.cursor="default"; this.readOnly=0; this.select(); this.focus(); \' ');
document.writeln('onblur=\'javascript:this.style.backgroundColor="transparent"; this.style.borderWidth=0; this.style.cursor="hand"; this.readOnly=1; this.value='+varMe+'.year;dispDate('+varMe+'); \' '); //tbl'+varMe+'.focus();
document.writeln('onkeypress=\'javascript:if (window.event.keyCode==13||window.event.keyCode ==27){ if (window.event.keyCode==13) '+varMe+'.year=this.value; this.blur(); }else if (window.event.keyCode<48||window.event.keyCode>57) window.event.keyCode =0;\'');
document.writeln('readonly maxlength=4>');
//=====================
document.writeln('年<span onclick=\''+varMe+'.year='+varMe+'.year+1;year'+varMe+'.innerText='+varMe+'.year;dispDate('+varMe+');\'>▲</span><span onclick=\''+varMe+'.year='+varMe+'.year-1;year'+varMe+'.innerText='+varMe+'.year;dispDate('+varMe+');\'>▼</span>');
document.writeln (' ');
document.writeln('<span id=month'+varMe+'>'+this.month+'</span>月<span onclick=\''+varMe+'.month='+varMe+'.month+1;if('+varMe+'.month>12) '+varMe+'.month=1;month'+varMe+'.innerText='+varMe+'.month;dispDate('+varMe+');\'>▲</span><span onclick=\''+varMe+'.month='+varMe+'.month-1;if('+varMe+'.month<1) '+varMe+'.month=12;month'+varMe+'.innerText='+varMe+'.month;dispDate('+varMe+');\'>▼</span>');
document.writeln("</td></tr>");
document.writeln('<TR yellow; " bgcolor=DarkSlateBlue><TD>日</TD><TD>一</TD><TD>二</TD><TD>三</TD><TD>四</TD><TD>五</T
日期控件
80酷酷网 80kuku.com