onclick="cztz('chance.do?method=upJhPlan&id=${li.plaId})&jh='+document.getElementById("jh").value

解决方案 »

  1.   

    把每一组数据放在一个form里,提交的时候使用document.forms[下标].submit()的方式提交
      

  2.   

    像这种表单上需要提交多个值的情况就别用什么JS提交了
    给table套一个form
    后再把参数名对应好,提交之后想要什么拿什么不就完了,id大不了放到隐藏域
    何必这么麻烦
      

  3.   

    看错了,你的貌似是修改列表,那更简单
    在Action定义一个List或者数组
    给你的foreach标签顶一个varStatus,比如varStatus="aaa"
    aaa.index可以取到循环的索引
    你的表单的name可以这样传:jh[aaa.index]
    这样后台的List或者数组就能对应上
    最后在后台遍历更新就OK了
      

  4.   

    document.getElementById("jh").value---改为 name 然后索引 放 foreach 的index。
    没看清循环
      

  5.   


    <c:forEach items="${list}" var="li">
    <tr>
    <td class="list_data_ltext" height="24">
    <input id="jh${li.plaId}" name="jh" value="${li.plaTodo }" />
    <input type="button"  value="保存" onclick="cztz('chance.do?method=upJhPlan&id=${li.plaId}','${li.plaId}')">
    </td>
    </tr>
    </c:forEach>
    function cztz(url,id){
    var name = document.getElementById("jh"+id).value;
    window.location.href = url+"&name="+name;
    }
    第一,在你input的id属性中加上你当前id这样确保唯一。
    第二,在调用方法的时候,传入foreach中的id的值,这样确保你当前修改的正确性。
      

  6.   

    使用json可以!http://download.csdn.net/detail/ganshenml/6971413
      

  7.   

    4楼说的那样。前台遍历的时候,name值取数组名+下标。例如:name="userList[index].uName",index为遍历时的下标,userList为即将传到后台的数组,提交一次表单就可以了。
      

  8.   

    如果这样的话,你写一个js就OK了,用form估计不妥...