表格可能是有3列,id,name,money,现在我想根据 上边选择的radio不同,修改money列的值。如:radio选择第1个,那么money列 所有的值 都 +1
    radio选择第2个,那么money列 所有的值 都 +2我用的是struts2,修改后的列值还要提交到action的money[]中。
望,不领赐教。

解决方案 »

  1.   

    你吧form贴出来,就会有人给你写js代码的
    很简单的   网上也有很多资料
      

  2.   

    <form name = "formName" method="post"  action="add.action" >
    <input type="radio" id="rd" name="rd" value="1" onclick="selectDate(1);"/>
    <input type="radio" id="rd" name="rd" value="2" onclick="selectDate(2);"/><table >
    <s:iterator value="subCustList" id="aLine">
    <tr>
    <td ><input type="checkbox" id="id" name="id" 
        value="<s:property value="id"/>"
        onclick="selectitem('<s:property value="id"/>');"/></td>
    <td><s:property value="id"/></td>
    <td><s:property value="Name"/></td>
    <td><s:property value="Money"/></td>
    <input type="hidden" name="id"  value="<s:property value="id"/>" >
    <input type="hidden" name="Name"  value="<s:property value="Name"/>" >
    <input type="hidden" name="Money"  value="<s:property value="Money"/>" >
    </tr>
    </s:iterator>
    <tr>
    <td>   
    <input type="button" name="Submit" value="确认" style="cursor:hand" onClick="add();">
    </td>
    </tr>
    </table>
    </form>代码基本是这样的,选择radio后,table中的money整列每行的值分别+1,或者加+2。
    并且需要把修改后的值提交到add.action中的money[]中。