编辑框传值

<%@ page language="java" contentType="text/html;charset=GBK"
 pageEncoding="GBK"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
 <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <link href="${ctx}/css/menuList.css" type="text/css" rel="stylesheet" />
  <link href="${ctx}/css/body.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="${ctx}/selectFrame/dropdownlist1.js"></script>
  <script type="text/javascript" src="${ctx}/js/changeColor.js"></script>
  <script type="text/javascript"
   src="${ctx}/datecontrol/fPopUpCalendarDlg.js"></script>

</head>
<body leftMargin=0 topMargin=0
 onload="colorTip()" scroll="no" style="overflow:hidden">
 <FORM id="insertForm" method="post"
  action="${ctx}/xxby/xxby!xxbyInsert.action">
  <input type="hidden" name="continueTipsValue" id="continueTipsValue"/>

  <div id="savebuttonDiv" style="width: 100%; height: 100%">
   <td><img src="${ctx}/images/save.bmp" class="hand"
    id="savebutton" onclick="valueComfirm(0)" style="cursor: hand"
    alt="保存" /></td>
   <td><img src="${ctx}/images/continue.bmp" class="hand"
    id="savebuttoncontinue" onclick="valueComfirm(1)"
    style="cursor: hand" alt="保存并继续" /></td>
  </div>
  <DIV id=mydivid style="OVERFLOW-Y: auto; WIDTH: 100%;">
   <TABLE height="100%" width="100%" border=0>
    <TBODY>
     <TR>
      <TD id=InitZone vAlign=top>当前位置:小修保养管理&gt;&gt;<STRONG>日常巡查记录</STRONG>
       <HR id=null>
        <TABLE id=table_0 style="WIDTH: 612px; HEIGHT: 116px"
         cellSpacing=0 borderColorDark=#ffffff cellPadding=0
         align=center bgColor=#ffffff borderColorLight=#989898 border=1
         name="table_0" datamember="">
         <TBODY>
          <TR></TR>
          <TR>
           <TD vAlign=top align=middle>&nbsp;
            <TABLE id=TABLE_2 cellSpacing=1 cellPadding=1 border=0
             name="table_0" datamember="">
             <TBODY>
              <TR>
               <TD nowrap="nowrap" align="center">巡查单位</TD>
               <TD  nowrap="nowrap" align="left"><Input Type="text" id="txtCompName"
                NullTips="请选择巡查单位!" readonly="true" class="box"
                MaxLength="50" Size="13" name="organname1"
                DataType="varchar2" runat="server" value=""
                Style="WIDTH: 106px; HEIGHT: 15px; BACKGROUND-COLOR: #eaeaea"
                checkNull="true" DataIndex="1"><Input
                 Type="button" name="button_2" id="button_2"
                 toDataEx="(local);RCYH_NEWORG;companyName,companyNo[0];companyNo = '{companyNo}';organName,tCompNo;200,200"
                 class="mainstaycmdbutton" Size="13"
                 ButtonType="mscombobox" runat="server" value="6"
                 Style="DISPLAY: none; BORDER-LEFT: 0px; WIDTH: 21px; FONT-FAMILY: Webdings; HEIGHT: 13px"><Input
                  Style="WIDTH: 21px; FONT-FAMILY: Webdings; BORDER-LEFT-STYLE: none; HEIGHT: 19px"
                  Size="21" Type="button" name="button_5" runat="server"
                  value="6" class="mainstaycmdbutton" id="button_5"
                  >&nbsp;<FONT
                   color=#ff0000>*<input type="hidden"
                    id="organnameid" name="organname"></input>
                  </FONT>
               </TD>
               <TD  nowrap="nowrap" align="center">天气情况</TD>
               <TD  nowrap="nowrap" align="left"><Input Type="text" id="text_weather"
                NullTips="请填写天气情况!" class="box" MaxLength="25" Size="14"
                name="weather1" DataType="varchar2" runat="server"
                value="" checkNull="true" DataSource="weather"
                DataIndex="1" style="HEIGHT: 15px"><Input
                 Style="WIDTH: 21px; FONT-FAMILY: Webdings; BORDER-LEFT-STYLE: none; HEIGHT: 19px"
                 Type="button" value="6" name="button_1" id="button_1"
                 class="mainstaycmdbutton">&nbsp;<FONT
                  color=#ff0000>*<input type="hidden"
                   id="weatherid" name="weather" />
                 </FONT>
               </TD>
              </TR>
              <TR>
               <TD  nowrap="nowrap" align="center">巡查路线</TD>
               <TD  nowrap="nowrap" align="left"><Input Type="text" id="text_roadNo"
                NullTips="请选择路线名称!" readonly="true" class="box"
                MaxLength="200" Size="15" name="roadno"
                DataType="varchar2" runat="server" value=""
                Style="BACKGROUND-COLOR: #eaeaea;WIDTH: 106px; HEIGHT: 15px;height:17px" checkNull="true"
                DataSource="roadNo" DataIndex="1" ><Input
                  Style="WIDTH: 21px; FONT-FAMILY: Webdings; BORDER-LEFT-STYLE: none; HEIGHT: 21px"
                  Type="button" name="button_4" runat="server" value="6"
                  class="mainstaycmdbutton" id="button_4"
                  >&nbsp;<FONT
                   color=#ff0000>*</FONT>
               </TD>
               <TD  nowrap="nowrap" align="center">巡查日期</TD>
               <TD  nowrap="nowrap" align="left"><Input Type="text" id="txtDate"
                NullTips="请输入【巡查日期】!" readonly="true" class="box"
                Size="14" name="patroldate" DataType="date"
                runat="server" value=""
                Style="BACKGROUND-COLOR: #eaeaea;height:17px" checkNull="true"
                DataIndex="1" HEIGHT="13px"><Input
                 Style="BORDER-LEFT: 0px; WIDTH: 22px; FONT-FAMILY: Webdings; HEIGHT: 21px"
                 Type="button" name="button_0" runat="server" value="6"
                 class="mainstaycmdbutton" ButtonType="browsedate"
                 id="button_0"
                 onclick="CalendarDlg(txtDate);return false;">&nbsp;<FONT
                  color=#ff0000>*</FONT>
               </TD>
              </TR>
              <TR>
               <TD  nowrap="nowrap" style="WIDTH: 85px" align="center">巡查人</TD>
               <TD  nowrap="nowrap" style="WIDTH: 165px" align=left><Input
                Type="text" id="text_principal" class="box"
                MaxLength="25" Size="15" name="principal1" value=""
                checkNull="true" DataSource="principal" DataIndex="1" style="WIDTH: 106px; HEIGHT: 17px;"><Input
                 Style="WIDTH: 21px; FONT-FAMILY: Webdings; BORDER-LEFT-STYLE: none; HEIGHT: 21px"
                 Type="button" name="button_6" runat="server"
                 value="6" class="mainstaycmdbutton"
                 id="button_6">&nbsp;<FONT color=#ff0000>*</FONT><input
                  type="hidden" id="principalid" name="principal" />
               </TD>
               <TD style="WIDTH: 90px" align=right>&nbsp;</TD>
               <TD style="WIDTH: 170px" align=left>&nbsp;&nbsp;</TD>
              </TR>
             </TBODY>
            </TABLE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <Input Type="button" name="GetAreaNo1" id="GetAreaNo1"
            toDataEx="(local);RCYH_NEWORG;companyNo;companyName = '{organName}' and companyNo = '{companyNo}';tCompNo"
            Size="12" ButtonType="autocomplate" runat="server"
            value="GetAreaNo1"
            Style="DISPLAY: none; WIDTH: 107px; HEIGHT: 22px">&nbsp;&nbsp;
             <Input Style="DISPLAY: none; WIDTH: 153px; HEIGHT: 21px"
             Size="204" Type="text" name="tCompNo" runat="server"
             DataSource="tCompNo" class="box" id="tCompNo">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            
           </TD>
          </TR>
         </TBODY>
        </TABLE>
        <br />
        <TABLE id=table_0 style="WIDTH: 610px" cellSpacing=0
         borderColorDark=#ffffff cellPadding=0 width=610 align=center
         bgColor=#ffffff borderColorLight=#989898 border=1
         name="table_0" datamember="">

         <TR>
          <TD vAlign=top align=middle>&nbsp;
           
            <TABLE id=table_1 style="WIDTH: 444px; HEIGHT: 79px"
             height=800 cellSpacing=1 cellPadding=1 width=444 border=0
             name="table_1" DataMember="RCYH_PATROLINFO">
             <TBODY>
              <TR>
               <TD>&nbsp;</TD>
               <TD align="center" style="width: 70px">巡查部位</TD>
               <TD align="center" style="width: 70px"> 巡查内容</TD>
               <TD align="center">桩号</TD>
               <TD align="center">数量</TD>
               <TD>&nbsp;</TD>
               <TD align="center" style="width: 70px">处理措施</TD>
              </TR>

              <c:forEach var="resultList" items="${resultList}"
               varStatus="status">
               <tr>

                <td  nowrap="nowrap" align="center"><span id="status${status.index}"
                 style="font-size: 9pt;"> <input
                  style="text-align: center; border: 0; width: 50px"
                  readOnly="true" name="index"
                  value="${status.index + 1}" /> <input type="hidden"
                  value="${resultList.itemidx}" name="itemid">
                </span></td>
                <td  nowrap="nowrap" align="center"><input name="patrolcontent1"
                 readonly="true"
                 style="text-align: center; border: 0; font-size: 9pt; text-border: 0px; width: 70px"
                 value="${resultList.patrolpart}"></input> <input
                 name="patrolcontent" type="hidden"
                 value="${resultList.patrolpart}" /></td>
                <td  nowrap="nowrap" align="center"><input name="patrolpart1"
                 readonly="true" value="${resultList.patrolcontexnt}"
                 style="font-size: 9pt; text-align: center; border: 0; width: 70px"></input>
                 <input name="patrolpart" type="hidden"
                 value="${resultList.patrolcontexnt}" /></td>
                <td  nowrap="nowrap" align="center"><input type="text" name="pegno"
                 class="box" onpaste="return false"
                 style="width: 50px" /></td>

                <td  nowrap="nowrap" align="center"><input type="text" name="icount"
                 id="icount" size="10" class="box"
                 value="${resultList.amount}"
                 onkeyup="value=value.replace(/[^\d.]/g,'')"
                 onpaste="return false" /> <span id="gvList_ctl02_lblZD"
                 style="font-size: 9pt; width: 50px"></span></td>
                <td  nowrap="nowrap" align="center"><input type="text" id="unit1"
                 readonly="true" value="${resultList.unit}"
                 style="border: 0; width: 30px" /> <input type="hidden"
                 name="unit" readonly="true" value="${resultList.unit}" />
                </td>
                <td  nowrap="nowrap" align="center"><input type="textarea"
                 id="handlemeasure${status.index}" name="handlemeasure"
                 style="display:none; width: 70px" /> <input
                 type="button" class="mainstaycmdbutton"
                  value="编辑" style="width: 70px"
                 onclick="editorInfo(${status.index})" />
                 <input type="hidden" id = "tempHM${status.index}"/>
                </td>
               </tr>
              </c:forEach>

             </TBODY>
            </TABLE>
            <P id=P_1>
             <Input Type="hidden" id="txtCompNo" class="box"
              name="companyno" value="" /> <Input Type="hidden"
              name="txtSmallCNo" class="box" id="txtSmallCNo" />
            </P>
           </TD>
         </TR>
        </TABLE>
      </TD>
     </TR>
    </TBODY>
   </TABLE>
  </DIV>
 </FORM>
</body>
</html>
<script language="javascript" type="text/javascript">
String.prototype.replaceAll = function (s1, s2) {
   var r = new RegExp(s1.replace(/([\(\)\[\]\{\}\^\¥\+\-\*\?\.\"\""\|\/\\]) /g, "\\¥1"),"ig");
   return this.replace(r,s2);
}
function editorInfo(index){   //编辑框传值相关
 var handlemeasure = document.getElementById("handlemeasure" + index);
 var temp = document.getElementById("tempHM" + index);
 var vResult = null;
 
    vResult = window.showModalDialog("../detail.jsp", temp.value, "status:no;help:no;resizable:yes;dialogWidth:500px;dialogHeight:450px");
  
    if (vResult != null && vResult != undefined)
    {
  temp.value = vResult;
     handlemeasure.value=encodeURIComponent(unescape(vResult.replaceAll('%0D%0A','<br />')));
    }
}


function valueComfirm(value){
 if(value==1) {
  document.getElementById("continueTipsValue").value = 1;
 }

 if(document.getElementById("txtCompName").value==null ||document.getElementById("txtCompName").value==""){
  alert("请选择巡查单位!!");
  return false;
 }
 if(document.getElementById("text_weather").value==null ||document.getElementById("text_weather").value==""){
  alert("请选择天气!!");
  return false;
 }
 if(document.getElementById("text_roadNo").value==null ||document.getElementById("text_roadNo").value==""){
  alert("请选择路线!!");
  return false;
 }
 if(document.getElementById("txtDate").value==null ||document.getElementById("txtDate").value==""){
  alert("请选择巡查日期!!");
  return false;
 }
 if(document.getElementById("text_principal").value==null ||document.getElementById("text_principal").value==""){
  alert("请选择巡查人!!");
  return false;
 }
 document.getElementById("organnameid").value= encodeURIComponent(document.getElementById("txtCompName").value);
 document.getElementById("weatherid").value= encodeURIComponent(document.getElementById("text_weather").value);
 document.getElementById("principalid").value= encodeURIComponent(document.getElementById("text_principal").value);
 
 if(window.confirm("确定保存吗?")){
  document.getElementById("insertForm").submit(); 
 }else{
  return false;
 }
}
function colorTip(){
 
 var obj4=document.getElementsByName("patrolcontent1");
  var obj6=document.getElementsByName("index");
    var obj1=document.getElementsByName("patrolpart1");
 var obj2=document.getElementsByName("icount");
 var obj5=document.getElementsByName("unit1");
 var unit = document.getElementsByName("unit");
 var patrolpart = document.getElementsByName("patrolpart");
 var patrolcontent = document.getElementsByName("patrolcontent");
 
 for (var i = 0; i < unit.length; i++)
 {
  patrolcontent[i].value = encodeURIComponent(patrolcontent[i].value);
  patrolpart[i].value = encodeURIComponent(patrolpart[i].value);
  unit[i].value = encodeURIComponent(unit[i].value);
 }
 
 
  for(i=0;i<obj4.length;i++){
   if(obj1[i].value=="其他"){
     obj2[i].style.visibility = "hidden";
   }else{
        obj2[i].style.visibility = "visible";
   }
   if(obj4[i].value=="路基" || obj4[i].value=="桥梁" || obj4[i].value=="挡墙" || obj4[i].value=="标志标线" || obj4[i].value=="绿化"){
             obj4[i].parentElement.parentElement.style.backgroundColor="#86C7FB";
          obj1[i].style.backgroundColor= "#86C7FB";
          obj4[i].style.backgroundColor= "#86C7FB";
           obj5[i].style.backgroundColor="#86C7FB";
           obj6[i].style.backgroundColor="#86C7FB";
         }else{
         obj4[i].parentElement.parentElement.style.backgroundColor="#B1CDBE";
         obj1[i].style.backgroundColor= "#B1CDBE";
          obj4[i].style.backgroundColor= "#B1CDBE";
          obj5[i].style.backgroundColor= "#B1CDBE";
          obj6[i].style.backgroundColor= "#B1CDBE";
      }
  }
  document.getElementById("txtCompNo").value='<%=session.getAttribute("ld_companyno")%>';
 
}

//这里写入自定义代码的相关对象的初始化过程

var test = new DropDownList(document.getElementById('button_6'),315,200);
test.addAssign("text_principal" ,"empname");
test.addShowContentByKey("empname");
test.createTitle("员工名称");
test.createPageTurning();
test.thisOnclickBefore = function() {
 var organName = document.getElementById("txtCompName").value;
 if(organName == "") {alert("请先选择【巡查单位】!");document.getElementById("txtCompName").focus();return false;}
 this.url = "${ctx}/commonoper/commonOper.action?_xmlName=rcyh/select/employee&_ajax=1&vo.pageNo=$[pageNum]&organName=" + organName;
}
test = new DropDownList(document.getElementById('button_5'),315,200);
test.addAssign("txtCompName" ,"companyname");
test.addAssign("tCompNo" ,"companyno");
test.addShowContentByKey("companyname");
test.createTitle("机构名称");
test.createPageTurning();
test.url = '${ctx}/commonoper/commonOper.action?_xmlName=rcyh/select/neworg&_ajax=1&companyno=<%=session.getAttribute("ld_companyno")%>&vo.pageNo=$[pageNum]';

test = new DropDownList(document.getElementById('button_1'),220,200);
test.addAssign("text_weather" ,"dtname");
test.addShowContentByKey("dtname");
test.createTitle("天气情况");
test.url = '${ctx}/commonoper/commonOper.action?_xmlName=datadict/weather&_ajax=1';

test = new DropDownList(document.getElementById('button_4'),315,200);
test.addAssign("text_roadNo" ,"roadlineno");
test.addShowContentByKey("roadlineno,roadlinename");
test.createTitle("路线编号,路线名称");
test.createPageTurning();
test.createSearch("<span style='font-weight:100;font-size:12px;'>&nbsp;路线编号:<input class='box' style='WIDTH: 60px; HEIGHT: 18px;' id='_roadno_"+"' type='text'>&nbsp;路线名称:<input class='box' style='WIDTH: 60px; HEIGHT: 18px;' id='_roadname_' type='text'>&nbsp;<img id='_roadsearch_' title='搜索' src='../selectFrame/imgs/magnifierSearch.gif' style='margin-top:4px;cursor:pointer' alt='搜索' height='15' width='15' /></span>","_roadsearch_");
test.setSearch('_roadno_');
test.setSearch('_roadname_');
test.url = "${ctx}/commonoper/commonOper.action?_xmlName=rcyh/select/wayRoad&_ajax=1&vo.pageNo=$[pageNum]&roadlineno=$[_roadno_]&roadlinename=$[_roadname_]";

function selectWin(){
var top = document.body.clientHeight/8;
var left = document.body.clientWidth/2 + 50;
       window.open('${ctx}/roadInfoSelect/roadInfoSelect!selectWinXCLX.action',"","width=" + "500" + ",height=" + "580" + ",top=" + top + ",left=" + left + ",location=0,scrollbars=yes");
}
</SCRIPT>

------------------------------------------------------------------------------------------------------

detail.jsp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ include file="/common/taglibs.jsp" %>
<html>
 <head>
 <title>编辑详情</title>
 </head>
 <body onload="frmload()">
  <textarea id="v2" name="v2" style="width:400px;height:400px"> </textarea>
   </br>
  <input id="confirm" type="button" value="确定" onclick="closewindow();" />
 
 </body>
</html>
<script>
  String.prototype.replaceAll = function (s1, s2) {
   var r = new RegExp(s1.replace(/([\(\)\[\]\{\}\^\¥\+\-\*\?\.\"\""\|\/\\]) /g, "\\¥1"),"ig");
   return this.replace(r,s2);
  }

  function frmload()
  {
   value = window.dialogArguments;
   document.getElementById("v2").value=unescape(value);
  }
  function closewindow()
  {
   var escapeStr = escape(document.getElementById("v2").value);
   window.returnValue = escapeStr;
      window.close()
  }
</script>

猜你喜欢

转载自blog.csdn.net/klicky/article/details/9250785