日期:2014-05-17 浏览次数:21009 次
<script language="javascript"> function test() { var LEN = document.getElementById("qty").value; for(var i=1; i<=LEN ; i++) { if(document.getElementById("weeknumber" + i).value=="") { alert("周别不能为空!") document.getElementById("weeknumber" + i).focus(); return false; } } } </script> <form id="form1" name="form1" method="post" action=""> <% for i=1 to 5 %> <input type="text" name="weeknumber<%=i%>" id="weeknumber<%=i%>"/><br /> <% next %> <input name="qty" id="qty" type="hidden" value="<%= i-1%>" /> <input type="submit" name="button" id="button" value="提交" onclick="test();" /> </form>