日期:2014-05-17  浏览次数:20891 次

有没有比较好用漂亮一点的日历控件啊
就是一点就自动在文本框生成日期那种

------解决方案--------------------
这个我用的还可以。。。
<!--输入框-->
<input name= "Thedate " type= "text " class= "txt " id= "Thedate " style= "cursor:hand " onClick= "javascript:showcalendar(this); " size= "6 " readonly value= " <%=thedate%> ">

<!--脚本-->
<script>
function showcalendar(obj)
{
dv=window.showModalDialog( "../e2e/calendar.htm ", "44 ", "center:1;help:no;Status:no;dialogHeight:246px;dialogWidth:216px;scroll:no ")
if (dv) {if (dv== "null ") obj.value= ' ';else obj.value=dv;}
}
</script>

<!--calendar.htm代码-->
<style type= "text/css ">
body {
background-color: #D4D0C8;
}
.c_fieldset {
padding: 0,10,5,10;
text-align: center;
width: 180px;
}
.c_legend {
font-family: Tahoma;
font-size: 11px;
padding-bottom: 5px;
}
.c_frameborder {
border-left: 2px inset #D4D0C8;
border-top: 2px inset #D4D0C8;
border-right: 2px inset #FFFFFF;
border-bottom: 2px inset #FFFFFF;
background-color: #FFFFFF;
overflow: hidden;
font-family: "Tahoma ";
font-size: 10px;
width:160px;
height:120px;
}
.c_frameborder td {
width: 23px;
height: 16px;
font-family: "Tahoma ";
font-size: 11px;
text-align: center;
cursor: default;
}
.c_frameborder .selected {
background-color:#0A246A;
color:white;
}
.c_frameborder span {
width:12px;
height:12px;
}
.c_arrow {
width: 16px;
height: 8px;
font-family: "Webdings ";
font-size: 7px;
line-height: 2px;
padding-left: 2px;
cursor: default;
}
.c_year {
font-family: "Tahoma ";
font-size: 11px;
cursor: default;
width:55px;
height:19px;
}
.c_month {
width:75px;
height:20px;
font:11px "Tahoma ";
}
.c_dateHead {
background-color:#808080;
color:#D4D0C8;
}
</style>

<script language= "javascript ">
// Written by cloudchen, 2004/03/16
function calendar(name,fName)
{
var calendar=this
this.name = name;
this.fName = fName || "calendar ";
this.year = new Date().getFullYear();
this.month = new Date().getMonth();
this.date = new Date().getDate();
//private
this.toString = function()
{
var str = " ";
str += " <table border=\ "0\ " cellspacing=\ "3\ " cellpadding=\ "0\ " onselectstart=\ "return false\ "> ";
str += " <tr> ";
str += " <td> ";
str += this.drawMonth();
str += " </td> ";
str += " <td align=\ "right\ "> ";
str += this.drawYear();
str += " </td> ";
str += " </tr> ";
str += " <tr> ";
str += " <td colspan=\ "2\ "> ";
str += " <div class=\ "c_frameborder\ "> ";
str += " <table border=\ "0\ " cellspacing=\ "0\ " cellpadding=\ "0\ " class=\ "c_dateHead\ "> ";
str += " <tr> ";
str += "