calenda.css<================>A:link { color: #0000FF; TEXT-DECORATION: none;}
A:visited { COLOR: #0000FF; TEXT-DECORATION: none}
A:active  { COLOR: #3333ff; TEXT-DECORATION: none}
A:hover   { COLOR: #ff0000; TEXT-DECORATION: none}body { font-size: 10pt; font-family:Verdana; SCROLLBAR-FACE-COLOR: rgb(198,214,250); SCROLLBAR-3DLIGHT-COLOR: rgb(158,180,214); SCROLLBAR-ARROW-COLOR:  #4B5B7F;}
.bodycolor { BACKGROUND: #ffffff; background-image: url("../admin/img/bg.gif");}
.outbodycolor { background-color: #264989; background-repeat: repeat; background-attachment: 
               scroll; background-image: 
               url('images/bg1.gif'); 
               background-position: 0% }
.small  { font-size: 9pt;}
.small1  { font-size: 9pt;COLOR: #000000;}
.big { font-size: 12pt;}
.big1   { font-size: 12pt;COLOR: #000000;}
.big2   { font-size: 18pt}
.verybig{ font-size: 24pt}
input.SmallButton{ BORDER-RIGHT: #104a7b 1px solid black; BORDER-TOP: #afc4d5 1px solid black; BORDER-LEFT: #afc4d5 1px solid black; BORDER-BOTTOM: #104a7b 1px solid; background-image: url("../images/button_back.gif"); CURSOR: hand; COLOR: #000066; HEIGHT: 19px; FONT-SIZE: 9pt;  TEXT-DECORATION: none}
input.BigButton  { BORDER-RIGHT: #104a7b 1px solid black; BORDER-TOP: #afc4d5 1px solid black; BORDER-LEFT: #afc4d5 1px solid black; BORDER-BOTTOM: #104a7b 1px solid; background-image: url("../images/button_back.gif"); CURSOR: hand; COLOR: #000066; HEIGHT: 19px; FONT-SIZE: 12pt; TEXT-DECORATION: none}
input.SmallInput { COLOR: #000066; BACKGROUND: #F8F8F8; border:1 solid black; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal}
input.SmallInput1{ COLOR: #000066; BACKGROUND: #F8F8F8; border:1 solid black; BORDER-RIGHT:0; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal}
input.BigInput   { COLOR: #000066; BACKGROUND: #F8F8F8; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 12pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 22px; LINE-HEIGHT: normal}
input.BigInputMoney{COLOR:#000066; BACKGROUND: #F8F8F8; text-align: RIGHT; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 12pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 22px; LINE-HEIGHT: normal}input.SmallStatic{ COLOR: #000066; BACKGROUND: #E0E0E0; border:1 solid black; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal}
input.BigStatic  { COLOR: #000066; BACKGROUND: #E0E0E0; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 12pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 22px; LINE-HEIGHT: normal}
select.BigSelect  { COLOR: #000066; BACKGROUND: #F8F8F8; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 12pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 22px; LINE-HEIGHT: normal}
select.SmallSelect{ COLOR: #000066; BACKGROUND: #F8F8F8; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal}select.BigStatic  { COLOR: #000066; BACKGROUND: #E0E0E0; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 12pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 22px; LINE-HEIGHT: normal}
select.SmallStatic{ COLOR: #000066; BACKGROUND: #E0E0E0; border:1 solid black; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal}
textarea.BigInput { COLOR: #000066; BACKGROUND: #F8F8F8; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal;LINE-HEIGHT: normal;}
textarea.BigStatic{ COLOR: #000066; BACKGROUND: #E0E0E0; border:1 solid black; BORDER-BOTTOM:1px double; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal;LINE-HEIGHT: normal;}
.TableControl{ BACKGROUND: #EFF7FF;}
.TableHeader { BACKGROUND: #D3E5FA; color: #FFFFFF; font-weight: bold; background-image: url("images/headerbg.gif") }
.TableContent{ BACKGROUND: #E2E8FA;}
.TableData   { BACKGROUND: #FFFFFF;}
.TableLine1  { BACKGROUND: #F3F3F3;}
.TableLine2  { BACKGROUND: #FFFFFF;}.deletebg {  font-family: "宋体"; font-size: 12px; border-color: black black #000000; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px;text-align:center;}.querybg {  font-family: "宋体"; font-size: 12px; border-color: black black #000000; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}.toolbutton { BORDER-RIGHT: #104a7b 1px solid;    BORDER-TOP: #afc4d5 1px solid;    BACKGROUND: #d6e7ef;    BORDER-LEFT: #afc4d5 1px solid;    CURSOR: hand;    COLOR: #000066;    BORDER-BOTTOM: #104a7b 1px solid; margin: 0pt; width: 60pt;  HEIGHT: 18px;    FONT-SIZE: 9pt;    TEXT-DECORATION: none;background-image: url("images/button_back.gif");}

解决方案 »

  1.   

    calenda.php<================><?
    $FIELDNAME = $_GET['FIELDNAME'];
    if($FIELDNAME == NULL /*|| strlen($FIELDNAME) < 10*/) exit (调用错误);
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel="stylesheet" type="text/css" href="./include/calendar.css">
    <link rel="stylesheet" type="text/css" href="./calendar.css"><script language="JavaScript">
    function MM_findObj(n, d) { //v4.0
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && document.getElementById) x=document.getElementById(n); return x;
    }function doCal()
    {
      n=new Date();
      cm="<?=date(m)?>";  n.setFullYear("<?=date(Y)?>");
      n.setMonth(cm-1);  writeMonth(n);
    }function set_year(op)
    {
      if(op==-1 && document.form1.YEAR.selectedIndex==0)
         return;
      if(op==1 && document.form1.YEAR.selectedIndex==(document.form1.YEAR.options.length-1))
         return;  document.form1.YEAR.selectedIndex=document.form1.YEAR.selectedIndex+op;  yr=document.form1.YEAR.value;
      cm=document.form1.MONTH.value;
      doOther(yr,cm);
    }function set_mon(op)
    {
      if(op==-1 && document.form1.MONTH.selectedIndex==0)
         return;
      if(op==1 && document.form1.MONTH.selectedIndex==(document.form1.MONTH.options.length-1))
         return;  document.form1.MONTH.selectedIndex=document.form1.MONTH.selectedIndex+op;  yr=document.form1.YEAR.value;
      cm=document.form1.MONTH.value;
      doOther(yr,cm);
    }function doOther(yr,cm)
    {
      n=new Date();
      n.setFullYear(yr);
      n.setMonth(cm-1);
      writeMonth(n);
    }function writeMonth(n)
    {
      yr=document.form1.YEAR.value;
      cm=document.form1.MONTH.value;
      n.setDate(1);dow=n.getDay();moy=n.getMonth();  for (i=0;i<41;i++)
      {
        if ((i<dow)||(moy!=n.getMonth()))
           dt="&nbsp;";
        else
        {
          dt=n.getDate();
          n.setDate(n.getDate()+1);      if(dt==<?=date(d)?>&&cm==<?=date(m)?>&&yr==<?=date(Y)?>)
             dt="<a href='#' onclick='dateClick("+dt+")'><font color=red>"+dt+"</font></a>";
          else
             dt="<a href='#' onclick='dateClick("+dt+")'>"+dt+"</a>";
        }    MM_findObj('day')[i].innerHTML="<b>"+dt+"</b>";
      }
    }function setPointer(theRow, thePointerColor)
    {
       theRow.bgColor = thePointerColor;
    }var parent_window = window.dialogArguments;function dateClick(theDate)
    {
       yr=document.form1.YEAR.value;
       cm=document.form1.MONTH.value;   date_str=yr+"-"+cm+"-"+theDate;
       parent_window.<?=$FIELDNAME?>.value=date_str;
       window.close();
    }function thisMonth()
    {
       document.form1.YEAR.selectedIndex=(2005-1930);
       document.form1.MONTH.selectedIndex=(<?=date(m)?>-1);
       doCal();
    }
    </script>
    <style type="text/css">
    <!--
    body,td,th { color: #000000;}
    -->
    </style></head><body class="bodycolor" onload="doCal();" topmargin="0" leftmargin="0">
    <form action="#"  method="post" name="form1">
    <table width="100%" border="0" cellspacing="1" class="small" bgcolor="#000000" cellpadding="3" align="center">
      <tr align="center" class="bodycolor">
        <td colspan="7" class="big1">
    <!-------------- 年 ------------>
            <input type="button" value="〈" class="SmallButton" title="上一年" onclick="set_year(-1);"><select name="YEAR" class="SmallSelect" onchange="set_year(0);">
    <? for ($tyear=1930;$tyear<=2050;$tyear++) { ?>
    <? $selected = (date(Y) == $tyear)?"selected":""; ?>
              <option value="<?=$tyear?>" <?=$selected?>><?=$tyear?></option>
    <? }?>
            </select><input type="button" value="〉" class="SmallButton" title="下一年" onclick="set_year(1);"> <b>年</b><!-------------- 月 ------------>
            <input type="button" value="〈" class="SmallButton" title="上一月" onclick="set_mon(-1);"><select name="MONTH" class="SmallSelect" onchange="set_mon(0);">
    <? for ($tmonth=1;$tmonth<=12;$tmonth++) { ?>
    <? $selected = (date(m) == $tmonth)?"selected":""; ?>
              <option value="<?=$tmonth?>" <?=$selected?>><?=$tmonth?></option>
    <? }?>
            </select><input type="button" value="〉" class="SmallButton" title="下一月" onclick="set_mon(1);"> <b>月</b>    </td>
      </tr>
      <tr align="center" class="TableHeader">
        <td width="14%" bgcolor="#FFCCFF"><b>日</b></td>
        <td width="14%"><b>一</b></td>
        <td width="14%"><b>二</b></td>
        <td width="14%"><b>三</b></td>
        <td width="14%"><b>四</b></td>
        <td width="14%"><b>五</b></td>
        <td width="14%" bgcolor="#CCFFCC"><b>六</b></td>
      </tr>
      

  2.   


      <tr bgcolor="#FFFFFF" align="center" style="cursor:hand">
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
      </tr>
      <tr bgcolor="#FFFFFF" align="center" style="cursor:hand">
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
      </tr>
      <tr bgcolor="#FFFFFF" align="center" style="cursor:hand">
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
      </tr>
      <tr bgcolor="#FFFFFF" align="center" style="cursor:hand">
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
      </tr>
      <tr bgcolor="#FFFFFF" align="center" style="cursor:hand">
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
      </tr>
      <tr bgcolor="#FFFFFF" align="center" style="cursor:hand">
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%" id="day" onmouseover="setPointer(this,'#E2E8FA')" onmouseout="setPointer(this,'')"></td>
        <td width="14%"><a href="#" onclick="thisMonth();"><b>本月</b></a></td>
      </tr>
    </table></form></body>
    </html>
      

  3.   

    谢谢CCTV MTV 谢谢中央电视台,谢谢csdn,谢谢gzty(风逍遥) 让俺搞了个日期.......
    我还想要时间的控件,要求有分钟的