日期:2014-05-16 浏览次数:20405 次
<c:forEach items="${list}" var="list" varStatus="s"> <tr align="center" style="color: red"> <td>${list.id}</td> <td>${list.yclName}</td> <td>${list.guige}</td> <td>${list.shuliang}</td> <td>${list. fasr}</td> <td>暂无</td> <td>${list.fsrq}</td> <td><input id="day${s.count}" type="text" class="input2" name="day"/></td>//重点。给LIST中的每个INPUT赋予不同的ID。方便JS使用 <td> <c:if test="${list.beizhu eq null}">无</c:if> <c:if test="${list.beizhu ne null}">${list.beizhu}</c:if> </td> <td>未处理</td> <td><a href="javascript:tiaozhuan('${s.count}','${list.id}','${list.flag}')">确认</a></td> </tr> </c:forEach>
//js <script type="text/javascript"> function tiaozhuan(a,b,c){ var val = document.getElementById("day"+a).value; if(val!=""){ if(isNaN(val)){ alert("请输入数字!"); }else{ window.location = "ylbzRequest.do?method=updateYlbzRequest&id="+b+"&flag="+c+"&day="+val; } }else{ alert("请输入时间!"); } } </script>