function valuecheck() { var totalprint=0; for (i = 1;i <= N1;i++) { inputi.value = N3[i]; if (inputi.value > N2[i]) alert("本次打印张数不能大于未打印的张数!") if (checkboxi.selected == true) totalprint = totalprint + inputi.value; } if (totalprint > M) alert("选择的打印张数总和不能大于默认打印张数!") } </script>
<script language="javascript"> <!--var maxrecord=99;for(i=1;i<=maxrecord;i++) { if frmPrint.selectprint+'i'.checked=true then printsum=printsum+1 end ifif Cint(printsum)=0 then msgbox "未选择订单进行凭证打印!" exit sub end ifprintsum=0 if frmPrint.selectprint+'i'.checked=true then printsum=printsum+cint(frmPrint.printnum+'i'.value) end if }if Cint(printsum)>Cint(frmPrint.select+'i'.value ) then msgbox "打印张数超出凭证张数!请重新选择!" exit sub end ifif frmPrint.printall.checked=true then if frmprint.selectprint+'i'.disabled = false then frmPrint.selectprint+'i'.checked=true end if else frmPrint.selectprint+'i'.checked=false end if--> </script>
否则如下
var 默认张数=50function 取得选择记录的张数(){..}sub 打印N页(n){..}sub 点选其中一个记录()
{
if(被选择)
{
if(本次打印数>未打印数||本次打印数<1){报错,取消选择}
if(取得选择记录的张数()>默认打印张数){报错,取消选择}
选择记录循环
{
打印N页(本次打印数)
本次打印数=0
未打印数-本次打印数
}
}
{
if(被选择)
{
if(本次打印数>未打印数||本次打印数<1){报错,取消选择}
if(取得选择记录的张数()>默认打印张数){报错,取消选择}
}
sub 开始打印()
{
选择记录循环
{
打印N页(本次打印数)
本次打印数=0
未打印数-本次打印数
}
}
{
var totalprint=0;
for (i = 1;i <= N1;i++)
{
inputi.value = N3[i];
if (inputi.value > N2[i])
alert("本次打印张数不能大于未打印的张数!")
if (checkboxi.selected == true)
totalprint = totalprint + inputi.value;
}
if (totalprint > M)
alert("选择的打印张数总和不能大于默认打印张数!")
}
</script>
<tr bgcolor="#006699">
<td width="70" height="25" align="center"><font color="#FFFFFF">选择</font></td>
<td width="100" align="center"><font color="#FFFFFF">未打印张数</font></td>
<td width="100" align="center"><font color="#FFFFFF">本次打印张数</font></td>
</tr>
<tr bgcolor="#DEE3E7">
<td width="70" height="25" align="center"> <input type="checkbox" name="checkbox" value="checkbox"></td>
<td width="100" align="center">10</td>
<td width="100" align="center"> <input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#ecf0f6">
<td height="25" align="center"><input type="checkbox" name="checkbox2" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#DEE3E7">
<td height="25" align="center"> <input type="checkbox" name="checkbox3" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#ecf0f6">
<td height="25" align="center"><input type="checkbox" name="checkbox4" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#DEE3E7">
<td height="25" align="center"> <input type="checkbox" name="checkbox5" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#ecf0f6">
<td height="25" align="center"><input type="checkbox" name="checkbox6" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#DEE3E7">
<td height="25" align="center"> <input type="checkbox" name="checkbox7" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#ecf0f6">
<td height="25" align="center"><input type="checkbox" name="checkbox8" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#DEE3E7">
<td height="24" align="center"> <input type="checkbox" name="checkbox9" value="checkbox"></td>
<td align="center">10</td>
<td align="center">
<input name="textfield22" type="text" value="10" size="5" maxlength="3"></td>
</tr>
<tr bgcolor="#ecf0f6">
<td height="21" colspan="2" align="right">设置每次最多连续打印
<select name="select3">
<option>30</option>
<option>40</option>
<option selected>50</option>
<option>60</option>
<option>70</option>
<option>80</option>
<option>90</option>
</select>
张凭证</td>
<td height="21" align="center">
<input name="multiprint" type="button" id="multiprint" value="打印凭证">
</td>
</tr>
</table>
<!--var maxrecord=99;for(i=1;i<=maxrecord;i++)
{
if frmPrint.selectprint+'i'.checked=true then
printsum=printsum+1
end ifif Cint(printsum)=0 then
msgbox "未选择订单进行凭证打印!"
exit sub
end ifprintsum=0
if frmPrint.selectprint+'i'.checked=true then
printsum=printsum+cint(frmPrint.printnum+'i'.value)
end if
}if Cint(printsum)>Cint(frmPrint.select+'i'.value ) then
msgbox "打印张数超出凭证张数!请重新选择!"
exit sub
end ifif frmPrint.printall.checked=true then
if frmprint.selectprint+'i'.disabled = false then
frmPrint.selectprint+'i'.checked=true
end if
else
frmPrint.selectprint+'i'.checked=false
end if-->
</script>