以下 HTML 文档包含一个应由脚本提交的表单。文本字段的值最初设置为 50000,表单在新窗口中提交,脚本停止,但这不是我想要的;我希望脚本为 50000 打开新窗口,然后对 50001、50002、...、55000 执行相同操作,当然在同一个打开的窗口中
<html>
<head>
<script type="text/javascript">
function now(){
for (i=50000;i<=55000;i++){
document.getElementById("candidate_id").value=i;
document.forms["here"].submit();
}
}
</script>
</head>
<body onload="now()">
<form accept-charset="UTF-8" action="http://www.naharnet.com/examresults" method="post" target="_blank" id="here" name="here">
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="ksuw0r4TRM80q1Sw+dBoYRSrw7tfxmjLpVIVyqJnnhs=" /></div>
<div class="row">
<h5 id="category">Exam Category</h5>
<select id="exam_category" name="exam_category">
<option value="SG">SG </option>
<option value="SV"> SV </option>
<option value="SE">SE</option>
<option value="LH">LH</option>
<option value="BR">BR</option></select>
</div>
<div id="padding">
<h5 id="cand_num">Candidate #</h5>
<input id="candidate_id" maxlength="5" name="candidate_id" type="text"/>
</div>
<div id="padding">
<input class="search_btn" name="commit" type="submit" value="Search"/>
</div>
</form>
</body></html>