<!--#include file="chksession.asp"--><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>下一步,工件信息錄入</title>
<%
dim lianluo
lianluo=request.querystring("lianluo")
types=request.querystring("types")
%>
<link href="css.css" rel="stylesheet" type="text/css">
<script language=javascript type=text/javascript>
<!--
var RES_BT_DELETE = "刪除";
var isIE = (navigator.userAgent.indexOf("MSIE") != -1);
var fileIndex = 1;
function addFile() {
var spanId = "filespan";
var fileId = "upload" + (fileIndex++);
addInputFile(spanId, fileId);
}
function addInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
if (span != null) {
var divObj = document.createElement("div"), lianluoObj, indexObj, tuhaoObj, taoObj, cailiaoObj, houObj, kuanObj, gaoObj, duObj, reObj, beizhuObj, delObj;
divObj.id = fileId;
if (isIE) {
lianluoObj = document.createElement("<input type=hidden>");
indexObj = document.createElement("<input type=text>");
tuhaoObj = document.createElement("<input type=text>");
taoObj = document.createElement("<input type=text>");
cailiaoObj = document.createElement("<input type=text>");
houObj = document.createElement("<input type=text>");
kuanObj = document.createElement("<input type=text>");
gaoObj = document.createElement("<input type=text>");
duObj = document.createElement("<input type=text>");
reObj = document.createElement("<input type=text>");
beizhuObj = document.createElement("<input type=text>");
delObj = document.createElement("<input type=button onclick=delInputFile('" + spanId + "','" + fileId + "')>");
} else {
lianluoObj = document.createElement("input");
lianluoObj.type = "hidden";
indexObj = document.createElement("input");
indexObj.type = "text";
tuhaoObj = document.createElement("input");
tuhaoObj.type = "text";
taoObj = document.createElement("input");
taoObj.type = "text";
cailiaoObj = document.createElement("input");
cailiaoObj.type = "text";
houObj = document.createElement("input");
houObj.type = "text";
kuanObj = document.createElement("input");
kuanObj.type = "text";
gaoObj = document.createElement("input");
gaoObj.type = "text";
duObj = document.createElement("input");
duObj.type = "text";
reObj = document.createElement("input");
reObj.type = "text";
beizhuObj = document.createElement("input");
beizhuObj.type = "text";
delObj = document.createElement("input");
delObj.type = "button";
delObj.setAttribute("onclick", "delInputFile('" + spanId + "','" + fileId + "')", 0);
}
lianluoObj.id = "lianluo";lianluoObj.value = '<%=lianluo%>';lianluoObj.name = "lianluo";
indexObj.name = "indexs";indexObj.disabled = true;indexObj.id = "indexs";indexObj.size = "6";indexObj.value = fileIndex;
tuhaoObj.name = "tuhao";tuhaoObj.id = "tuhao";tuhaoObj.size = "18";
taoObj.name = "tao";taoObj.id = "tao";taoObj.size = "8";
cailiaoObj.name = "cailiao";cailiaoObj.id = "cailiao";cailiaoObj.size = "8";
houObj.name = "hou";houObj.id = "hou";houObj.size = "8";
kuanObj.name = "kuan";kuanObj.id = "kuan";kuanObj.size = "8";
gaoObj.name = "gao";gaoObj.id = "gao";gaoObj.size = "8";
duObj.name = "du";duObj.id = "du";duObj.size = "8";
reObj.name = "re";reObj.id = "re";reObj.size = "8";
beizhuObj.name = "beizhu";beizhuObj.id = "beizhu";beizhuObj.size = "20";
delObj.value = RES_BT_DELETE;
divObj.appendChild(lianluoObj);
divObj.appendChild(indexObj);
divObj.appendChild(tuhaoObj);
divObj.appendChild(taoObj);
divObj.appendChild(cailiaoObj);
divObj.appendChild(houObj);
divObj.appendChild(kuanObj);
divObj.appendChild(gaoObj);
divObj.appendChild(duObj);
divObj.appendChild(reObj);
divObj.appendChild(beizhuObj);
divObj.appendChild(delObj);
span.appendChild(divObj);
}
}
function delInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
var divObj = document.getElementById(fileId);
if (span != null && divObj != null) {
span.removeChild(divObj);
}
}
//-->
</script>
<meta content="MSHTML 6.00.2800.1528" name=GENERATOR>
</head>
<body onkeydown="quickadd(event)">
<center>
<h3><strong><font color="#FF0000"> <%=lianluo%> </font></strong></h3>
</center>
<form name="form1" id="form1" action="gj_save.asp?lianluo=<%=lianluo%>&types=<%=types%>" method="post" onSubmit="return checkCnt();">
<table height=20 cellSpacing=1 cellPadding=8 width="90%" align=center>
<tbody>
<tr>
<TD id=filespan noWrap>
<div id=0>
<input name="11" type="text" id="11" size="6" value="序號" disabled><input name="22" type="text" id="22" size="18" value="圖號" disabled><input name="33" type="text" id="33" size="8" value="套" disabled><input name="44" type="text" id="44" size="8" value="材料" disabled><input name="55" type="text" id="55" size="8" value="厚" disabled><input name="66" type="text" id="66" size="8" value="寬" disabled><input name="77" type="text" id="77" size="8" value="長" disabled><input name="88" type="text" id="88" size="8" value="鍍" disabled><input name="99" type="text" id="99" size="8" value="熱" disabled><input name="00" type="text" id="00" size="20" value="備注" disabled>
</div>
<div id=1>
<input name="lianluo" type="hidden" id="linaluo" value="<%=lianluo%>"><input name="indexs" type="text" id="indexs" value="1" size="6" disabled><input name="tuhao" type="text" id="tuhao" size="18"><input name="tao" type="text" id="tao" onKeyUp="javascript:var v=this.value;this.value=this.value.replace(/\D/g,'');if(isNaN(v)&&v.length>0){document.all.jiagong.color='red';}" size="8" maxlength="3"><input name="cailiao" type="text" id="cailiao" size="8"><input name="hou" type="text" id="hou" size="8"><input name="kuan" type="text" id="kuan" size="8"><input name="gao" type="text" id="gao" size="8"><input name="du" type="text" id="du" size="8"><input name="re" type="text" id="re" size="8"><input name="beizhu" type="text" id="beizhu" size="20"><INPUT id=btnAdd onclick=addFile() type=button value=添加>
</div>
</TD>
</tr>
<tr>
<td noWrap align=center>
<input name="submit" type="submit" value="提交">
<input name="reset" type="button" onClick="javascript:window.location.href='grp_write.asp?lianluo=<%=lianluo%>';" value="添加购入品">
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
<script language="JavaScript">
cnt = 0;
function checkCnt(){
document.form1.Submit.disabled=true;
cnt++;
if (cnt!=1){
alert('正在提交數據. Please Wait');
return false;
}
}
function quickadd(event)
{
if(event.altKey && event.keyCode == 83)
{
if (cnt==0){
this.addFile();
}else{
alert('正在提交數據. Please Wait');
}
}
}
</script>
我曾以這樣寫
<input name="tao" type="text" id="tao" onKeyUp="javascript:var v=this.value;this.value=this.value.replace(/\D/g,'');if(isNaN(v)&&v.length>0){document.all.jiagong.color='red';}" size="8" maxlength="3">
這樣只有一行數據時有效果,可是多行數據時,第二行起就不能生效了,怎麼辦呢?
[此贴子已经被作者于2006-3-7 9:24:41编辑过]