<input name="set" type="text" id="set" size="12" onkeyup=javascript:form1.jine.value=form1.set.value*form1.danjia.value><input name="danjia" type="text" id="danjia" size="12" onkeyup=javascript:form1.jine.value=form1.set.value*form1.danjia.value><input name="jine" type="text" id="jine" size="12" readonly="true">
改成這樣就可以了。
可是我的是動態的啊?要昨啊??
<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, buObj, setObj, danjiaObj,jineObj, delObj;
divObj.id = fileId;
if (isIE) {
lianluoObj = document.createElement("<input type=hidden>");
indexObj = document.createElement("<input type=text>");
buObj = document.createElement("<input type=text>");
setObj = document.createElement("<input type=text>");
danjiaObj = document.createElement("<input type=text>");
jineObj = document.createElement("<input type=text readonly=true>");
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";
buObj = document.createElement("input");
buObj.type = "text";
setObj = document.createElement("input");
setObj.type = "text";
danjiaObj = document.createElement("input");
danjiaObj.type = "text";
jineObj = document.createElement("input");
jineObj.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;
buObj.name = "bu";buObj.id = "bu";buObj.size = "49";
setObj.name = "set";setObj.id = "set";setObj.size = "12";
danjiaObj.name = "danjia";danjiaObj.id = "danjia";danjiaObj.size = "12";
jineObj.name = "jine";jineObj.id = "jine";jineObj.size = "12";
delObj.value = RES_BT_DELETE;
divObj.appendChild(lianluoObj);
divObj.appendChild(indexObj);
divObj.appendChild(buObj);
divObj.appendChild(setObj);
divObj.appendChild(danjiaObj);
divObj.appendChild(jineObj);
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>