在JSP頁面裏時間範圍的寫法

/*************************************************************************************/

在JSP頁面裏時間範圍的寫法

/*************************************************************************************/

<%@page contentType="text/html;charset=Big5"%> <%@page import="java.util.*" %> <%@page import="java.text.*" %> <%@page import="java.sql.*" %> <%@page import="java.lang.String.*" %>

<script src="./JS/step.js"></script> <LINK href="style.css" type=text/css rel=stylesheet></LINK> <%   DateFormat myformat = new SimpleDateFormat("yyyy/MM/dd");   DateFormat myformat1 =new SimpleDateFormat("yyyyMMdd");   Calendar cal = Calendar.getInstance();   java.util.Date today = new java.util.Date();

%> <Script language="javaScript"> function addLabelProperties(f){  if(typeof f.getElementsByTagName == 'undefined') return;  var labels = f.getElementsByTagName("label"), label, elem, i = j = 0;    while (label = labels[i++]){   if(typeof label.htmlFor == 'undefined') return;   elem = document.getElementById(label.htmlFor);      if(typeof elem == 'undefined'){    //no label defined, find first sub-input    var inputs = label.getElementsByTagName("input");    if(inputs.length==0){     continue;    } else {     elem=inputs[0];    }   } else if(typeof elem.label != 'undefined') { // label property already added    continue;   } else if(typeof elem.length != 'undefined' && elem.length > 1 && elem.nodeName != 'SELECT'){    for(j=0; j<elem.length; j++){     elem.item(j).label = label;    }   }   elem.label = label;  } }

function check(p,p1,p21,p22,p3,p4) {  addLabelProperties(form1);  var inputs = form1.getElementsByTagName('input');   for (var i=0; i < inputs.length; i++)   {   if(inputs[i].value==p.value && p.name == "order")    {     inputs[i].label.className="radioOn";       select1(p1,p21,p22,p3,p4);    }   else if(inputs[i].name =="order")    {     inputs[i].label.className="radioOff";    }  }  }

function check2(p1,p21,p22,p3,p4) {  var sort="";

 if(p3.checked ==true)  {   sort=p3.value;  }  else if(p4.checked ==true)  {   sort=p4.value;   }

  window.open("excel.jsp?module="+p1+"&da1="+p21+"&da2="+p22+"&sort="+sort);

}

</Script> <html> <body> <form name="form1"> <table border=0 cellSpacing=0 cellPadding=0 align="center"> <tr> <td width="100" height="20"><strong>INC. DC</strong></td> <td width="900" height="700" rowspan="2"> <div id="a" style="display:block">

<table align="center"> <tr><td>       <font color="#FF8080"><strong>Incomplete non-lot data collection</strong></font> </td></tr> </table> </div>

<div id="b" style="display:none"> <table> <tr valign="top"> <td valign="top" height="20">      <button type="button" style="border-width:0;width:20;height:20;CURSOR: pointer;" οnclick=check2(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)>       <img  border="0" src="./img/excel1.gif" width="20" height="20">      </button>      EXCEL FILE </td> </tr> <tr valign="top">    <td height="700">     <div id="tabledis" style="overflow:auto;height:670">       <table id="large" cellspacing="1">       </table>     </div>    </td>   </tr>   </table>   </div>

</td> </tr> <tr valign="top"> <td width="100" height="670"> <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">Module:</font>   <div class="box">      <div class="box2">            <select name="module"  style="width:100px;color:#006cb4" οnchange=select1(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)>             <option>-SELECT-</option>             <option value="DIFF"> DIFF </option>                             <option value="ETCH"> ETCH </option>                             <option value="PHOTO"> PHOTO </option>                             <option value="CC"> CC </option>                             <option value="TF"> TF </option>                             <option value="DCM"> DCM </option>            </select>      </div>    </div>     <br>    <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">StartDate:</font>    <div class="box">      <div class="box2">            <select name="da1" style="width:100px;color:#006cb4" οnchange=select1(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d) >             <%              for(int i=0;i<=90;i++)              {                java.util.Date mydate = cal.getTime();                   out.println("<option value="+myformat1.format(mydate)+">"+myformat.format(mydate)+"</option>");                   cal.add(Calendar.DATE,-1);                out.println("</option>");              }              %>            </select>      </div>    </div>    <!--add "startdate" "enddate" for pc user to show undo message between startdate and enddate-->    <!--modified  by  rong chen on 20080703-->    <br>    <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">EndDate:</font>    <div class="box">      <div class="box2">            <select name="da2" style="width:100px;color:#006cb4" οnchange=select1(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d) >             <%       cal.add(Calendar.DATE,+91);              for(int i=0;i<=90;i++)              {          java.util.Date mydate = cal.getTime();                   out.println("<option value="+myformat1.format(mydate)+">"+myformat.format(mydate)+"</option>");                   cal.add(Calendar.DATE,-1);                out.println("</option>");              }              %>            </select>      </div>    </div>      <br>    <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">Sort by:</font>     <INPUT id=c type="radio" CHECKED value="eqpid" name="order" style="position:absolute;left:-1000px">&nbsp;<Label for=c οnclick="check(form1.c,form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)"  class="radioOn" >EQPId</LABEL><br>     <INPUT id=d type="radio" value="dcspecid" name="order" style="position:absolute;left:-1000px">&nbsp;<LABEL for=d οnclick="check(form1.d,form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)"  class="radioOff">Process</LABEL><br><br> </td> </tr> </table> </form> </body> </html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值