函数adddxin(non)没有被调用啊。
当然不显示结果。

解决方案 »

  1.   


    把代码都帖出来吧,我本来想调试一下,结果内容有好多方法都没有
    我运行了一下提示document.all.bigxm 为空或不是对象
      

  2.   

    应该addstr1这个字符串里面出什么问题了!
      

  3.   

     <span id="abcd"> </span>
      <script language="javascript"> function adddxin(non) { 
    var addstr1;
     var ano = non;
      addstr1+=' <tr bgcolor="#FFFFFF" id=rdxdd'+ano+'>'; 
      addstr1+=' <td> <input type=text name=a'+ano+' value='+'壹'+'> </td>'; 
      addstr1+=' <td> <input type=text name=b'+ano+'> </td>'; 
      addstr1+=' <td width=77> <input type=button name=Submit6 value=添加小项 onClick=addin('+ano+')> </td>' 
      addstr1+=' <td id=rtd'+ano+' width=357> <table id=kk'+ano+ano+'> <tr> <td width=290> <textarea name=c'+ano+' cols=35 rows=3 id=c'+ano+'> </textarea> </td> <td width=40> <input type=text  size=10 name=score'+ano+' id=score'+ano+'style="color:blue;border-color:green" value=""> <input type=button name=Submit6 value=删除小项 onClick=addoffa('+ano+ano+')> </td> </tr> </table> </td> <td width=78> <input type=text name=qz'+ano+' size=10 > </td>'; 
        addstr1+=' </tr>'; 
      document.getElementById("abcd").innerHTML=document.getElementById("abcd").innerHTML+addstr1; 

    adddxin('23')
    </script> 我这么写了一下,可以运行
      

  4.   

    document.all.abcd 也行,但建议不要这么写,有兼容问题
      

  5.   

    <script language="javascript"> 
    function adddxin(non) { 
    alert(non); 
    ano=parseInt(non) + 1; 
      var addstr1="",obj; 
      document.all.bigxm.value=ano; 
    alert( document.all.bigxm.value);   addstr1+=' <tr bgcolor="#FFFFFF" id=rdxdd'+ano+'>'; 
      addstr1+=' <td> <input type=text name=a'+ano+' value=Chinese(ano)> </td>'; 
      addstr1+=' <td> <input type=text name=b'+ano+'> </td>'; 
      addstr1+=' <td width=77> <input type=button name=Submit6 value=添加小项 onClick=addin('+ano+')> </td>' 
      addstr1+=' <td id=rtd'+ano+' width=357> <table id=kk'+ano+ano+'> <tr> <td width=290> <textarea name=c'+ano+' cols=35 rows=3 id=c'+ano+'> </textarea> </td> <td width=40> <input type=text  size=10 name=score'+ano+' id=score'+ano+'style="color:blue;border-color:green" value=""> <input type=button name=Submit6 value=删除小项 onClick=addoffa('+ano+ano+')> </td> </tr> </table> </td> <td width=78> <input type=text name=qz'+ano+' size=10 > </td>'; 
        addstr1+=' </tr>'; 
      document.all.abcd.innerHTML=document.all.abcd.innerHTML+addstr1; 
    } </script> 
    <input type="text" name="bigxm">
    <span id="abcd"></span>
    <script language="javascript"> 
    adddxin("1") ;
    </script>
      

  6.   

    <!--#include file="inc/conn.asp"-->
    <script language="javascript" type="text/javascript">function    Chinese(num)  
       {   
               if(!/^\d*(\.\d*)?$/.test(num))
         {
          alert("你输入的不是数字,请重新输入!");   
          return    false;
         }    
               var    AA    =    new    Array("十","一","二","三","四","五","六","七","八","九"); 
               var    BB    =    new    Array("","十","0","","","","","");               
               var    a    =    (""+    num).replace(/(^0*)/g,    "").split("."),    k    =    0,    re    =    ""; 
              for(var    i=a[0].length-1;    i>=0;    i--) 
               {   
            switch(k)   
                       { 
           case    0    :   
                    re    =    BB[7]    +    re;  
               break;   
                       case    4    :   
                      if(!new    RegExp("0{4}\\d{"+    (a[0].length-i-1)    +"}$").test(a[0]))   
                                        re    =    BB[4]    +    re;  
            break;   
                        case    8    :  
                   re    =    BB[5]    +    re;  
             BB[7]    =    BB[5];  
             k    =    0;  
            break;   
                       }   
                       if(k%4    ==    2    &&    a[0].charAt(i)=="0"    &&    a[0].charAt(i+2)    !=    "0")    re    =    AA[0]    +    re;   
                       if(a[0].charAt(i)    !=    0)    re    =    AA[a[0].charAt(i)]    +    BB[k%4]    +    re;   
           k++;   
               }    
               if(a.length>1) {   
                        re +=BB[6];
                       for(var    i=0;    i<a[1].length;    i++)    re    +=    AA[a[1].charAt(i)];   
               }   
       
               return    re;   
       }
    </script>
    <script language="javascript">
    var sn=1;function addin(no){
       var obj,obj2,addstr;
       sn=sn+no
      addstr="<table id=\"cc"+ sn + "\"> <tr> <td width=\"290\" > <textarea name=\"c" + no + "\" cols=\"35\" rows=\"3\" id=\"c" + no + "\"> <\/textarea> <\/td> <td width=\"40\" align=\"center\" valign=\"middle\" bgcolor=\"#FFFFFF\"> <input style=\"color:blue;border-color:green;font-family:'新宋体'\" name=\"score" + no + "\" type=\"text\" id=\"score" + no + "\" size=\"10\" \/> <input type=\"button\" name=\"Submit6\" value=\"删除小项\" onClick=\"addoff("+sn+")\" /><\/td> <\/tr> <\/table>";
       obj=eval("rtd"+no);
       obj.innerHTML=obj.innerHTML+addstr;
       //alert(document.form1.i1.value);
    }function addoff(no)
    {
       var aa2
       aa2="cc"+no
       document.getElementById(aa2).removeNode(true); 
         
     }function addoffa(no)
    {
       var aa1
       aa1="kk"+no
       document.getElementById(aa1).removeNode(true); 
         
     }
    function check2(num)
    {
       for(i=1;i<num;i++)
       {
          if(document.form1.content+i.value=="")
      {
         alert("请将信息填写完整!");
     return false
      }
          if(document.form1.score+i.value=="")
      {
         alert("请将信息填写完整!");
     return false
      }
          if(document.form1.beizhu+i.value=="")
      {
         alert("请将信息填写完整!");
     return false
      }
       }
       return true
    }
    function check()
    {
       if(document.form1.ucpart.value=="")
       {
          alert("请选择单位!");
      return false
       }
       if(document.form1.upart.value=="")
       {
          alert("请选择部门!");
      return false
       }
       if(document.form1.upost.value=="")
       {
          alert("请选择岗位!");
      return false
       }
       return true
    }
    </script>
    <script language="javascript">
    function adddxin(non){
     alert(non);
     ano=parseInt(non) + 1;
       var addstr1,obj;
      document.all.bigxm.value=ano;
    alert( document.all.bigxm.value);   addstr1+='<tr bgcolor="#FFFFFF" id=rdxdd'+ano+'>';
       addstr1+='<td><input type=text name=a'+ano+' value='+Chinese(ano)+'></td>';
       addstr1+='<td><input type=text name=b'+ano+'></td>';
       addstr1+='<td width=77><input type=button name=Submit6 value=添加小项 onClick=addin('+ano+')></td>'
       addstr1+='<td id=rtd'+ano+' width=357><table id=kk'+ano+ano+'><tr><td width=290><textarea name=c'+ano+' cols=35 rows=3 id=c'+ano+'></textarea></td><td width=40><input type=text  size=10 name=score'+ano+' id=score'+ano+'style="color:blue;border-color:green" value=""><input type=button name=Submit6 value=删除小项 onClick=addoffa('+ano+ano+')></td></tr></table></td><td width=78><input type=text name=qz'+ano+' size=10 ></td>';
        addstr1+='</tr>';
       document.getElementById("abcd").innerHTML=document.getElementById("abcd").innerHTML+addstr1;
    }</script><head>
    <script language="javascript" type="text/javascript" src="WdatePicker.js"></script><style type="text/css"> div.RoundedCorner{background: #5AAE18} b.rtop, b.rbottom{display:block;background: #FFF} b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden; background: #5AAE18} b.r1{margin: 0 4px} b.r2{margin: 0 3px} b.r3{margin: 0 2px} b.rtop b.r4, {margin: 0 1px;height: 1px}.style1 { font-size: 9px; color: #FFFFFF;font-weight: bold;} </style>
    <link href="../kpcss/textarea.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .style2 {color: #FFFFFF }-->
    </style>
    <style type="text/css">
    <!--
    body {
    margin-top: 2px;
    }
    .style3 {color: #999999}
    -->
    </style>
    </head>
      

  7.   

    <body>
    <%
    set rs=server.CreateObject("adodb.recordset")
    sql="select * from stitle where stitleno='"&request("stitleno")&"'"
    rs.open sql,conn,1,1
    a=rs("b_x")
    khzb=split(rs("khzb"),"||")
    zbms=split(rs("zbms"),"||")
    score=split(rs("score"),"||")
    qz=split(rs("qz"),"||")
    dxmx=split(rs("dxmx"),"||")
    %>
    <form method="post" name="form2" id="form2" action="?type=step2">
    <table   width="697" border="0" cellpadding="3" cellspacing="1" bgcolor="#5AAE18" >
    <tr bgcolor="#FFFFFF">
          <td width="67">
      <div align="right">
            <p align="left"><strong><font size="2">考评部门:</font></strong></div>
      
      </td>
      <td width="242">
      <div align="left"><strong><font size="2"><%= rs("sdeptname") %>
            </font>
      <input type="hidden" id="id" name="id" size="30" value="<%=id%>" readonly>
      <input type="hidden" id="sdeptno" name="sdeptno" size="30" value="<%=rs("sdeptno")%>" readonly></strong></div>
    </td>
          <td width="80" align="right">
      <div align="left"><strong><font size="2">考评岗位:</font></strong>
            <font size="2">               
            &nbsp;</font></div>       
      </td>
      <td width="268">
      <div align="left"><font size="2"><%= rs("stitlename") %></font><strong>
       <input type="hidden" id="bigxm" name="bigxm" size="30" value="<%=rs("b_x")%>" readonly>
      <input type="hidden" id="stitleno" name="stitleno" size="30" value="<%=rs("stitleno")%>" readonly>
            </strong><input type="hidden" id="postid" name="postid"   style="color:green" value="<%=rs("stitleno")%>" readonly></div>    
      </td>
          </tr><tr bgcolor="#FFFFFF">
          <td width="67"><div align="left"><strong><font size="2">考评时间:</font></strong></div>
      </td>
      <td width="242">
      <div align="left"><strong>
          <font size="2">
      开始时间                           
      <input type="text" id="a_stime" name="a_stime" size="5"  value="<%=rs("a_stime")%>" onFocus="new WdatePicker(this,'%D',true)" readonly>
      
     
          个人结束                           
    <input type="text" id="a_etime" name="a_etime" size="5"   value="<%=rs("a_etime")%>" onFocus="new WdatePicker(this,'%D',true)" readonly>
     部门结束                           
     <input type="text" id="dept_time" name="dept_time" size="5" onFocus="new WdatePicker(this,'%D',true)" readonly value="<%=rs("dept_time")%>">
     公司结束                           
     <input type="text" id="com_time" name="com_time" size="5" onFocus="new WdatePicker(this,'%D',true)" readonly value="<%=rs("com_time")%>">
          </font>
      </strong></div>
      </td>
          <td width="80" align="right">
      <div align="left">
      <strong><font size="2">总结结时间:</font></strong></div>
      </td>
      <td width="268">
      <div align="left"><strong>
          <font size="2">
      开始                           
      <input type="text" id="s_stime" name="s_stime" size="5"   value="<%=rs("s_stime")%>" onFocus="new WdatePicker(this,'%D',true)" readonly >
      结束                           
      <input type="text" id="s_etime" name="s_etime" size="5"   value="<%=rs("s_etime")%>" onFocus="new WdatePicker(this,'%D',true)" readonly>
          </font>
      </strong></div></td>
          </tr></table>
      
    <table id="rdx1" width="732" border="0" cellpadding="3" cellspacing="1" bgcolor="#5AAE18">
    <tr bgcolor="#FFFFFF"><td width="1"></td><td width="66"><font size="2">项目</SPAN></font></td><td width="92"><font size="2">考核指标</font></td><td width="77"></td><td width="357"><table><tr><td width="290"><font size="2">指标要求</font></td><td width="40"><font size="2">分值</font></td></tr></table></td><td width="78"><font size="2">权重</font></td></tr><%for i=1 to a%>
    <tr bgcolor="#FFFFFF" id="rdxdd<%=i%>" ><td width="1"></td><td width="66">
    <input type="text" name="a<%=i%>" size="5" value="<%=dxmx(i-1)%>" readonly>
    </td>
    <td width="92"><input type="text" name="b<%=i%>" size=10 value=<%=khzb(i-1)%>></td>
    <td width="77">
    <input type="button" name="Submit6" value="添加小项" onClick="addin(<%=i%>)"/>
    </td>
    <td id="rtd<%=i%>" width="357">
    <%for k=1 to ubound(split(zbms(i-1),","))%><table id="kk<%=i&k%>"><tr><td width="290">
    <textarea name="c<%=i%>" cols="35" rows="3" id="c<%=i%>"><%=replace(split(zbms(i-1),",")(k-1)," ","")%></textarea>
    </td>
    <td width="40">
    <input type="text"  size="10" name="score<%=i%>" id="score<%=i%>" style="color:blue;border-color:green;font-family:'新宋体'" value="<%=replace(split(score(i-1),",")(k-1)," ","")%>">
    <input type="button" name="Submit6" value="删除小项" onClick="addoffa(<%=i&k%>)"/>
    </td>
    </tr>
    </table>
    <%next%>
    </td><td width="78"><input type="text" name="qz<%=i%>" size=10 value="<%=qz(i-1)%>"></td></tr><%next%>
    <span id="abcd"></span>
    </table>
    <div align="center"><input type="button" name="zjdx" value="增加大项" onClick=adddxin(document.getElementById("bigxm").value) />   <input type="submit" name="action" value="修改" />             <input type="button" name="reset" value="取消" onClick="javascript:;window.location.reload()"/></div>
    </form><%if request("type")="step2" thenfor i= 1 to request("bigxm")
    tmp=tmp&request("a"&i)&"||"
    tmp1=tmp1&request("b"&i)&"||"
    tmp2=request("score"&i)&","
    tmp5=tmp5&tmp2&"||"
    zbms=request("c"&i)&","
    zbms1=zbms1&zbms&"||"
    tmp3=tmp3&request("qz"&i)&"||"
    next
    set rs=server.CreateObject("adodb.recordset")
    sql="select * from stitle where stitleno='"&request("stitleno")&"'"
    rs.open sql,conn,3,3 
    rs("b_x")=request("bigxm")
    rs("khzb")=tmp1
    rs("zbms")=zbms1
    rs("dxmx")=tmp
    rs("score")=tmp5
    rs("qz")=tmp3
    rs("a_stime")=request("a_stime")
    rs("a_etime")=request("a_etime")
    rs("dept_time")=request("dept_time")
    rs("com_time")=request("com_time")
    rs("s_stime")=request("s_stime")
    rs("s_etime")=request("s_etime")
    rs.update
    rs.close
    set rs=nothing
    response.Redirect("post.asp")
    end if%>