中午发的那个应该是我把问题搞错了 。应该是页面脚本有错误 页面代码:
<body>
  <html:hidden name="sy" property="arrange_no_hid" styleId="arrange_no_hid"/>
<div id="fragment-1">
       <table id="tab1" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
          <thead>
             <tr>
                <th>
                   学号
                </th>
                <th>
                   姓名
                </th>
                <th>
                   班级
                </th>
                <logic:iterate id="item" name="sy" property="item_2_Name"
indexId="i">

<th>
<bean:write name="item" property="item_2_name"/>
</th>

</logic:iterate>

             </tr>
          </thead>
             <tbody>
               <logic:iterate id="item" name="sy" property="studentDataList"
indexId="i">
<tr align="center">
     <td>
                    <bean:write name="item" property="student_id"/>
                 </td>
                 <td>
                    <bean:write name="item" property="student_name"/>
                 </td>
                 <td>
                    <bean:write name="item" property="class_no"/>
                 </td>
                 <logic:iterate id="item" name="sy" property="item_2_Name"
indexId="i">

 <td>
<html:hidden name="item" property="item_1_p"/>
                    <input type="checkbox" id="check">
                    <html:hidden name="item" property="jiajianfen"/>
                 </td>

</logic:iterate>               </tr>
               </logic:iterate>
             </tbody>
       </table>
 </div><input type="button" id="sendbutton" value="提交">  </body>
得到一个这样的页面现在想实现 点击 提交 以后 往后台传送数据,执行ACTION里的pingfen(),每个评分项目对应了一个权值和加减分的分值,如果checkbox被选中 则像后台传送它对应的student_id(学号), item_1_p(权值),jiajianfen(分值) js代码:<script type="text/javascript">
$(document).ready(function (){    $("#sendbutton").click(fuction(){
         int i,j;
         var str;
         var arrange_no=$("#arrange_no_hid").val();
         var tr=$("#tab1 tbody").find("tr");
         for(i=0;i<tr.length;i++){
             for(j=3;j<tr[i].length;j++){
               if(tr[i].eq(j).find("#check").is("checked")){
                      var student_id=tr[i].eq(0).val();
                      var item_1_p=tr[i].eq(j).find("#check").prev().val();
                      var jiajianfen=tr[i].eq(j).find("#check").next().val();
                    $.post("pingfen.action",{arrange_no:arrange_no,student_id:student_id,item_1_p:item_1_p,jiajianfen:jiajianfen});
                                             }
                                         }
                                   }
                                     });          });</script>求各位帮我看看
尤其是里面那个<td>节点我隐藏了2个值
                <td>
<html:hidden name="item" property="item_1_p"/>
                    <input type="checkbox" id="check">
                    <html:hidden name="item" property="jiajianfen"/>
                 </td>

解决方案 »

  1.   

    $(document).ready(function (){  $("#sendbutton").click(fuction(){
      int i,j;
      var str;
      var arrange_no=$("#arrange_no_hid").val();
      var tr=$("#tab1 tbody").find("tr");
      for(i=0;i<tr.length;i++){
      for(j=3;j<tr[i].length;j++){
      if(tr[i].eq(j).find("#check").is("checked")){
      var student_id=tr[i].eq(0).val();
      var item_1_p=tr[i].eq(j).find("#check").prev().val();
      var jiajianfen=tr[i].eq(j).find("#check").next().val();
      $.post("pingfen.action",{arrange_no:arrange_no,student_id:student_id,item_1_p:item_1_p,jiajianfen:jiajianfen});
      }
      }
      }
      });        });
    改成function
      

  2.   

    楼主你现在firebug下调试看看有什么错,对于jquery来说隐藏的元素一样可以取到值,没有关系,楼主是jsp吗?我看得挺想的,那Eclipse的控制台肯定有详细的报错,楼主贴出来,我这里没有你的环境
      

  3.   

    月月说的很对额 但是我现在点了提交 完全没反映 eclipse也不报错 可以的话加我QQ 远程帮我看看~?277452125