去掉上面的<script Language="javascript" src="/zjcx/js/wfrl.js"></script>

解决方案 »

  1.   

    把 document.frm 改成你自己的form的name: document.wyform
    另:没别事找事地把按钮的 name="submit" 你想正确运行的话,没取这样的关键字<html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href=/zjcx/css/New.css rel=stylesheet type=text/css>
    <style>
    td {white-space:nowrap;}
    </style>
    <title>维修登记</title>
    </head><!--自动增行功能-->
    <script>
    function zmx(ite){
     nn=eval(ite).rows.length;
     tt=eval(ite).rows[0].cells.length;
     r=eval(ite).insertRow();
     c=r.insertCell();
     c.align="center";
     c.innerText=nn;
     
     for(i=1;i<tt;i++)
     {
      h=eval(ite).rows[1].cells[i].getElementsByTagName("input")[0].outerHTML;
     c=r.insertCell();
     c.align="center";
     
     c.innerHTML=h;
     }
     
    document.wyform.mxcount.value=nn;
    }function prnmenu(obj){document.all.prn.style.display="";
    document.all.prn.style.left = event.clientX;
    document.all.prn.style.top = event.clientY;
    id1.innerText.onClick=zmx(obj);
    }function closeprnmenu(){
    document.all.prn.style.display="none";
    }
    function cx(){
      nn=mxb.rows.length;
      if(mxb.rows.length==2)
     {
       alert("请填写维修项目信息!");
       return false;
      }
      else{
         r=mxb.deleteRow();
           }
    document.wyform.mxcount.value=nn;
    }
    </script>
    <html><body topmargin="0">
    <%mxcount=0%>
    <div align="center">
    <form action="wxcx_save.asp" name="wyform" method="post" >  
      <div oncontextmenu="prnmenu('mxb');return false;" onClick="closeprnmenu();" id="frm1">
      <tr align="center"><td><font color="#990033" size="2">维修项目基本信息</font></td></tr>
      <input type="hidden" name="mxcount" value="<%=mxcount%>">  
      <table border="1" cellspacing="0" width="100%" cellpadding="0" bordercolorlight="#97bce5" bordercolor="#FFFFFF" id="mxb">
    <tr class="oa_t_th">
    <td width="5%" align="center" bgcolor="#e0ebf8" height="19">
    序号</td>
    <td width="27%" height="19" align="center" bgcolor="#e0ebf8">
    维修项目</td>
    <td width="16%" align="center" bgcolor="#e0ebf8" height="19">
    工时</td>
    <td width="16%" align="center" bgcolor="#e0ebf8" height="19">
    单价</td>
    <td width="16%" align="center" bgcolor="#e0ebf8">
    工时费</td>
    <td height="20" align="center" bgcolor="#e0ebf8">
    备注</td>
    </tr>     <tr>
     <%i=1%>
         <td align="center"><%=i%></td>
         <td height="28"><div align="center">
           <input type="text" name="fixItem" size="15" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="workTime" size="5" value="" onChange="checkInt(this);workCount(1);">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="Price" size="5" value="" onChange="workCount(1);">
           </div></td>
       <td height="28"><div align="center">
       <input type="text" name="workFee" size="5" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="desc" size="20" value="">
           </div></td>
        </tr>
      </table>
      </div>
      <br/>
      <table width="100%">
      <tr>
      <td align="center"><input type="button" name="ss" value="添加" onclick="zmx('mxb');">&nbsp;&nbsp;
      <input type="reset" name="rr" value="重置" ></td>
      </tr>
      </table>
      <div oncontextmenu="prnmenu('mxc');return false;" onClick="closeprnmenu();" id="frm2">
      <tr align="center"><td><font color="#990033" size="2">维修配件基本信息</font></td></tr>
      <table border="1" cellspacing="0" width="100%" cellpadding="0" bordercolorlight="#97bce5" bordercolor="#FFFFFF" id="mxc">
    <tr class="oa_t_th">
    <td width="5%" align="center" bgcolor="#e0ebf8" height="19">
    序号</td>
    <td width="10%" align="center" bgcolor="#e0ebf8" height="19">配件名称</td>
    <td width="10%" align="center" bgcolor="#e0ebf8" height="19">配件品牌</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">规格</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">型号</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">计量单位</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">数量</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">单价</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">优惠率</td>
    <td width="7%" align="center" bgcolor="#e0ebf8" height="19">配件总额</td>
    </tr>     <tr>
         <td align="center"><%=i%></td>
         <td height="28"><div align="center">
           <input type="text" name="AssName" size="10" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="AssBrand" size="5" value="">
           </div></td>
             <td height="28"><div align="center">
           <input type="text" name="AssSize" size="5" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="AssType" size="5" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="AssUnit" size="5" value="">
           </div></td>
       <td height="28"><div align="center">
           <input type="text" name="AssNum" size="5" value="">
           </div></td>
       <td height="28"><div align="center">
           <input type="text" name="AssPrice" size="5" value="">
           </div></td>
       <td height="28"><div align="center">
           <input type="text" name="AssCheap" size="10" value="">
           </div></td>
       <td height="28"><div align="center">
       <input type="text" name="AssTotal" size="10" value="">
       </div></td>
         </tr>
      </table>
      
      </div>
      
      <br >
      <table width="100%">
      <tr>
      <td align="center"><input type="button" name="ss" value="添加" onclick="zmx('mxc');">&nbsp;&nbsp;
      <input type="reset" name="rr" value="重置" ></td>
      </tr>
      </table>
    </form>
    <font style="font-size: 9pt" color="#800000">
    <div style="display:none;position: absolute; width: 53px; height: 40px; z-index: 1; left: 691px; top: 421px" id="prn" class="dontprn">
    <table border="1" cellspacing="0" cellpadding="0" bordercolorlight="#666666" bordercolordark="#FFFFFF" bgcolor="#ffffff">
    <tr>
      <td><input type="hidden" name="cfsj" value="<%=cfsj%>">
      <table border="0" cellspacing="0" cellpadding="0" width="38" style="word-wrap: break-word" id="frmzj">
           <tr><td height="5"></td></tr>
           <tr><td align="center"  onClick="zmx();" style="cursor:hand;" class="oa_t_th" id="id1">
           <font onmouseover="this.color='green'" onmouseout="this.color='black'">增加</font></td>
       </tr>
           <tr><td style="cursor:default;" height="3">
           <hr color="#FFFFFF" style="border: 1px groove #FFFFFF" height="3"></td></tr>
           <tr><td align="center" onClick="cx();" style="cursor:hand;"  class="oa_t_th">
           <font onmouseover="this.color='green'" onmouseout="this.color='black'">撤消</font></td>
       </tr>
       <tr><td style="cursor:default;" height="3">
           <hr color="#FFFFFF" style="border: 1px groove #FFFFFF" height="3"></td></tr>
           <tr><td align="center" onClick="closeprnmenu();" style="cursor:hand;"  class="oa_t_th">
           <font onmouseover="this.color='green'" onmouseout="this.color='black'">退出</font></td>
       </tr>
           <tr><td height="5"></td></tr>
       </table></td>
    </tr></table></div></font></div>
    <table border="1" cellspacing="0" width="100%" cellpadding="0" bordercolorlight="#97bce5" bordercolor="#FFFFFF" >
    <tr><td>操作手册:</td></tr>
    </table>
    <iframe width="0" height="0" frameborder="0" name="disposeCarId" id="disposeCarId" src=""></iframe>
    </body>
    </html>
      

  2.   

    .那个菜单的增加按钮失效是因为没有传参数,它不知道要给哪个表格加row.楼主非要这样实现,,只有把代码写复杂点了
      

  3.   

    挖哈哈,让我用ALTER不停的试,终于试出来了。。代码贴出来,功能很简单,方便以后的朋友用。。写的不规范,偶JS白痴,连定义都不清楚的说,不过终于实现了,开心。。随便顶者都有分<html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href=/zjcx/css/New.css rel=stylesheet type=text/css>
    <style>
    td {white-space:nowrap;}
    </style>
    <title>维修登记</title>
    </head><!--自动增行功能-->
    <script>
    function zmx(ite){
     nn=eval(ite).rows.length;
     tt=eval(ite).rows[0].cells.length;
     r=eval(ite).insertRow();
     c=r.insertCell();
     c.align="center";
     c.innerText=nn;
     
     for(i=1;i<tt;i++)
     {
      h=eval(ite).rows[1].cells[i].getElementsByTagName("input")[0].outerHTML;
     c=r.insertCell();
     c.align="center";
     
     c.innerHTML=h;
     }
     
    }function prnmenu(obj){document.all.prn.style.display="";
    document.all.prn.style.left = event.clientX;
    document.all.prn.style.top = event.clientY;
    id1.onclick=function anonymous(){zmx(obj);};
    id2.onclick=function anonymous(){cx(obj);};
    }function closeprnmenu(){
    document.all.prn.style.display="none";
    }function cx(ite){
      nn=eval(ite).rows.length;
      if(eval(ite).rows.length==2)
     {
       alert("请填写维修项目信息!");
       return false;
      }
      else{
         r=eval(ite).deleteRow();
           }}
    </script>
    <html><body topmargin="0">
    <%mxcount=0%>
    <div align="center">
    <form action="wxcx_save.asp" name="wyform" method="post" >
      
      <div oncontextmenu="prnmenu('mxb');return false;" onClick="closeprnmenu();" id="frm1">
      <tr align="center"><td><font color="#990033" size="2">维修项目基本信息</font></td></tr>
       
      <table border="1" cellspacing="0" width="100%" cellpadding="0" bordercolorlight="#97bce5" bordercolor="#FFFFFF" id="mxb">
    <tr class="oa_t_th">
    <td width="5%" align="center" bgcolor="#e0ebf8" height="19">
    序号</td>
    <td width="27%" height="19" align="center" bgcolor="#e0ebf8">
    维修项目</td>
    <td width="16%" align="center" bgcolor="#e0ebf8" height="19">
    工时</td>
    <td width="16%" align="center" bgcolor="#e0ebf8" height="19">
    单价</td>
    <td width="16%" align="center" bgcolor="#e0ebf8">
    工时费</td>
    <td height="20" align="center" bgcolor="#e0ebf8">
    备注</td>
    </tr>

         <tr>
     <%i=1%>
         <td align="center"><%=i%></td>
         <td height="28"><div align="center">
           <input type="text" name="fixItem" size="15" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="workTime" size="5" value="" onChange="checkInt(this);workCount(1);">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="Price" size="5" value="" onChange="workCount(1);">
           </div></td>
       <td height="28"><div align="center">
       <input type="text" name="workFee" size="5" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="desc" size="20" value="">
           </div></td>
        </tr>
      </table>
      </div>
      <br>
      <div oncontextmenu="prnmenu('mxc');return false;" onClick="closeprnmenu();" id="frm2">
      <tr align="center"><td><font color="#990033" size="2">维修配件基本信息</font></td></tr>
      <table border="1" cellspacing="0" width="100%" cellpadding="0" bordercolorlight="#97bce5" bordercolor="#FFFFFF" id="mxc">
    <tr class="oa_t_th">
    <td width="5%" align="center" bgcolor="#e0ebf8" height="19">
    序号</td>
    <td width="10%" align="center" bgcolor="#e0ebf8" height="19">配件名称</td>
    <td width="10%" align="center" bgcolor="#e0ebf8" height="19">配件品牌</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">规格</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">型号</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">计量单位</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">数量</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">单价</td>
    <td width="6%" align="center" bgcolor="#e0ebf8" height="19">优惠率</td>
    <td width="7%" align="center" bgcolor="#e0ebf8" height="19">配件总额</td>
    </tr>

         <tr>
         <td align="center"><%=i%></td>
         <td height="28"><div align="center">
           <input type="text" name="AssName" size="10" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="AssBrand" size="5" value="">
           </div></td>
             <td height="28"><div align="center">
           <input type="text" name="AssSize" size="5" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="AssType" size="5" value="">
           </div></td>
     <td height="28"><div align="center">
           <input type="text" name="AssUnit" size="5" value="">
           </div></td>
       <td height="28"><div align="center">
           <input type="text" name="AssNum" size="5" value="">
           </div></td>
       <td height="28"><div align="center">
           <input type="text" name="AssPrice" size="5" value="">
           </div></td>
       <td height="28"><div align="center">
           <input type="text" name="AssCheap" size="10" value="">
           </div></td>
       <td height="28"><div align="center">
       <input type="text" name="AssTotal" size="10" value="">
       </div></td>
         </tr>
      </table>
      
      </div>
      
      <br >
      <table width="100%">
      <tr>
      <td align="center"><input type="Submit" name="submit" value="添加" >&nbsp;&nbsp;
      <input type="reset" name="submit" value="重置" ></td>
      </tr>
      </table>
    </form>
    <font style="font-size: 9pt" color="#800000">
    <div style="display:none;position: absolute; width: 53px; height: 40px; z-index: 1; left: 691px; top: 421px" id="prn" class="dontprn">
    <table border="1" cellspacing="0" cellpadding="0" bordercolorlight="#666666" bordercolordark="#FFFFFF" bgcolor="#ffffff">
    <tr>
      <td>
      <table border="0" cellspacing="0" cellpadding="0" width="38" style="word-wrap: break-word">
           <tr><td height="5"></td></tr>
           <tr ><td align="center"  onClick="zmx();" style="cursor:hand;" class="oa_t_th" id="id1">
           <font onmouseover="this.color='green'" onmouseout="this.color='black'">增加</font></td>
       </tr>
           <tr><td style="cursor:default;" height="3">
           <hr color="#FFFFFF" style="border: 1px groove #FFFFFF" height="3"></td></tr>
           <tr><td align="center" onClick="cx('mxb');" style="cursor:hand;"  class="oa_t_th" id="id2">
           <font onmouseover="this.color='green'" onmouseout="this.color='black'">撤消</font></td>
       </tr>
       <tr><td style="cursor:default;" height="3">
           <hr color="#FFFFFF" style="border: 1px groove #FFFFFF" height="3"></td></tr>
           <tr><td align="center" onClick="closeprnmenu();" style="cursor:hand;"  class="oa_t_th">
           <font onmouseover="this.color='green'" onmouseout="this.color='black'">退出</font></td>
       </tr>
           <tr><td height="5"></td></tr>
       </table></td>
    </tr></table></div></font></div>
    <table border="1" cellspacing="0" width="100%" cellpadding="0" bordercolorlight="#97bce5" bordercolor="#FFFFFF" >
    <tr><td>操作手册:</td></tr>
    </table>
    <iframe width="0" height="0" frameborder="0" name="disposeCarId" id="disposeCarId" src=""></iframe>
    </body>
    </html>