三脚猫0304

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
<form id="form1" action="${ctx}/vehicleOwner_getVehicleOwnerList.do" method="post">
  <table class="tablelist mt5" id="picPx">
      <thead>
         <tr>
            <th width="2%">序号</th>
            <th width="5%">姓名</th>
             <th width="5%">身份证号</th>
             <th width="5%">排序号</th>
          </tr>
       </thead>
       <tbody>
          <c:forEach items="${list}" var="l"  varStatus="n">
              <tr>
                 <td class="tdcol">${n.count}</td>
                 <td class="tdcol">${l.name}</td> 
                 <td class="tdcol">${l.sfzh}</td>
                 <td class="tdcol">
                     <input style='width:50px'  id="pxh" name="pxh_${n.count}" type="text"  value="${l.pxh}" class="texts" onKeyUp="value=value.replace(/\D/g,'')" onafterpaste="value=value.replace(/\D/g,'')" />
                     <input style='width:50px'  id="sf" name="id_${n.count}" type="hidden"  value="${l.id}" class="texts"/>
                     <input style='width:50px'  id="sf" name="count" type="hidden"  value="${list.size()}" class="texts"/>
                 </td>
             </tr>
          </c:forEach>
      </tbody>
   </table>
   <div align="center" style="margin-top: 15px">
        <a href="javaScript:void(0)" style="text-decoration:none;color:#000000" onclick="doSave();" class="xxbj">
          <span>&nbsp;&nbsp;提交&nbsp;&nbsp;</span>
        </a>
   </div>           
</form>

有时黄色部分可能报错,改为${fn:length(list)}

<script type="text/javascript">
            function doSave() {
                 $.ajax({
                    type: "post",
                    url: "perInfoCollection_savePxh.do",
                    data: $("#form1").serialize(),
                    success: function(data) {
                        alert("提交成功!");
                        window.close();
                    },
                    error: function(data) {
                        alert(data);
                    }
                });
            }
</script>

 

posted on 2015-08-31 10:49  三脚猫0304  阅读(76)  评论(0)    收藏  举报