onclick="fz('<%=i%>',document.getElementById('txtwz'+<%=i%>).value)"

解决方案 »

  1.   

    onclick="fz('<%=i%>',document.getElementById('txtwz<%=i%>').value)"
      

  2.   

    onclick="fz('<%=i%>',this.value)"
      

  3.   

    Go_Rush(阿舜) 得不行
    ice_berg16(寻梦的稻草人) 得没有通用性
      

  4.   


    onclick="fz(<%=i%>, this.value);"
    function fz(index, sValue){
        alert(index);
        alert(sValue);
    }
      

  5.   

    onclick="fz('<%=i%>',eval(document.getElementById('txtwz<%=i%>').value))"
      

  6.   

    说实话,我也觉得草人的更加好一点,简单,假设如果从效率上来讲应该是草人的快,原因只用自己的对象,而用getElementById的话还要在重新遍历页面上的元素。
    可惜想法没办法测试。
      

  7.   

    如果我用一个按纽来触发这个事件的话怎么写啊
    比如这样
    <%for i=1 to 10%> 
    <form name=form<%=i%> >
    <table>
      <tr>
        <td>
        <input type=text name=txtwz<%=i%>>
      
        </td>
      </tr>
    <tr><td><input type=button name=btn1 onclick="fz(<%=i%>,)"></td></tr>
    </table>
    </form>
     <%next%>
      

  8.   

    这样可以吗onclick="fz(<%=i%>,eval("fz"+i).value);"