<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> 提交 </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>
时间: 2024-11-10 22:13:21