新微赢技术网
标题:
ASP運算?請問
[打印本页]
作者:
守护天使
时间:
2010-1-19 06:33
标题:
ASP運算?請問
<input name="set" type="text" id="set" size="12"><input name="danjia" type="text" id="danjia" size="12"><input name="jine" type="text" id="jine" size="12" readonly="true">
如果我要將set * danjia =jine
這個<input name="jine" type="text" id="jine" size="12" readonly="true"> 要怎麼寫?
作者:
ぁ贪ā.翫?
时间:
2010-1-19 06:33
<input name="jine" type="text" id="jine" size="12" readonly="true" onclick=javascript:this.value=form1.set.value*form1.danjia.value>
改成這樣後我點擊一下才能計算,能不能自動啊?
作者:
我只在乎你
时间:
2010-1-19 06:34
<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>
作者:
清风
时间:
2010-1-19 06:34
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
<!--
function SumPrice(){
document.all("jine").value = document.all("set").value * document.all("danjia").value;
}
//-->
</script>
</head>
<body>
<input name="set" type="text" id="set" size="12" onkeydown="SumPrice();" onkeyup="SumPrice();">
<input name="danjia" type="text" id="danjia" size="12" onkeydown="SumPrice();" onkeyup="SumPrice();">
<input name="jine" type="text" id="jine" size="12" readonly="true" onkeydown="SumPrice();" onkeyup="SumPrice();">
</body>
</html>
作者:
36D--的咪咪
时间:
2010-1-19 06:34
咽咽。謝謝
作者:
鸥飞007
时间:
2010-2-1 13:05
楼主,你写得实在是太好了。我惟一能做的,就只有把这个帖子顶上去这件事了
作者:
cheng9525
时间:
2010-3-15 05:05
走过路过,并且回个贴留下个脚印,因为我来过,呵呵
作者:
dg_gaga
时间:
2010-3-23 20:05
哈哈,~~怕怕~~不敢不回~~
欢迎光临 新微赢技术网 (http://bbs.weiying.cn/)
Powered by Discuz! X3.2