点击弹出日历框

点击弹出日历框

 

http://blog.csdn.net/highwell1/archive/2009/03/30/4037383.aspx

 

a.asp代码:


 


 


day.asp代码(也可以用其他现成的日历控件,注意参数。本例调用的是服务器的时间):

 
  选择日期                
  
  
    function getDay(v){
     window.opener.document.<%=request.querystring("form")%>.<%=request.querystring("field")%>.value=v;
     window.opener.document.<%=request.querystring("form")%>.<%=request.querystring("field")%>.focus();
     window.opener=null;
     window.close();
     return false;
    }
  
 
 
<%
oldDate=request("oldDate")
if not isDate(oldDate) then oldDate=date
yy=year(cdate(oldDate))
mm=month(cdate(oldDate))
if request("yy")<>"" then yy=request("yy")
if request("mm")<>"" then mm=request("mm")
if yy="" then yy=year(date)
if mm="" then mm=month(date)
if mm>12 then mm=1:yy=yy+1
if mm<1 then mm=12:yy=yy-1

dim m(12)
m(1)=31
m(3)=31
m(5)=31
m(7)=31
m(8)=31
m(10)=31
m(12)=31
m(2)=28
m(4)=30
m(6)=30
m(9)=30
m(11)=30
if (yy mod 4=0 and yy mod 100<>0) or yy mod 400=0 then m(2)=29
mms=m(mm)
week1=(weekday(cdate(yy & "-" & mm & "-1"))-1)
%>
    


     
      
       "
  for i=1 to week1
   response.write ""
 response.write "

       
        
         

           &field=<%=request("field")%>&yy=<%=(yy-1)%>&mm=<%=mm%>>
            7
          

         

           &field=<%=request("field")%>&mm=<%=(mm-1)%>&yy=<%=yy%>>
            3
          

         

           <%=yy%> 年   <%=mm%> 月
         

           &field=<%=request("field")%>&mm=<%=(mm+1)%>&yy=<%=yy%>>
            4
          

         

           &field=<%=request("field")%>&yy=<%=(yy+1)%>&mm=<%=mm%>>
            8
          

       

     

      

      

      

      

      

      

<%
if week1<>0 then
 response.write "
 "
  next
end if
for i=1 to mms
 if (i+week1-1) mod 7=0 then response.write "
"
 if cdate(yy & "-" & mm & "-" & i)=date() then
%>

 style="BORDER:#CD0101 1px groove;width:30;height:16;font-size:9pt;background-color:#FFD9D9;color:#CD0101"
 οnclick="javascript:getDay('<%=yy%>-<%=mm%>-<%=i%>');" title="<%=yy%>年<%=mm%>月<%=i%>日(今天)">
<%
 else
%>

 style="BORDER:#000000 1px groove;width:30;height:16;font-size:9pt;background-color:#ffffff;color:#000000"
 οnclick="javascript:getDay('<%=yy%>-<%=mm%>-<%=i%>');" title="<%=yy%>年<%=mm%>月<%=i%>日">
<%
 end if
next
if (mms+week1) mod 7<>0 then
 for i=1 to (7-((mms+week1) mod 7))
  response.write "
 "
 next
end if
%>
    



 

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/highwell1/archive/2009/03/30/4037383.aspx

你可能感兴趣的:(3000-网络程序设计,日历,javascript,input,autocomplete,button,border)