<html>
<head>
<title>Purhcase Order 蹦潦虫</title>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<link rel="stylesheet" href="images/style.css" type="text/css">
<SCRIPT LANGUAGE=javascript>
<!--
var rowIndex = 0;
function AddOneLine_onclick()
{
var row = Table1.insertRow(Table1.rows.length);
var col = row.insertCell(0);
col.innerHTML = "<input name=Category id=Category size=20>";
col = row.insertCell(1);
col.innerHTML = " <textarea name=Description id=Description rows=2 cols=35></textarea>";
col = row.insertCell(2);
col.innerHTML = " <input type=text name=Qty id =Qty size=4 onchange='getTo(this);'>";
col = row.insertCell(3);
col.innerHTML = " <input type=text name=UnitPrice id=UnitPrice size=10 onchange='getTo(this)'>";
col = row.insertCell(4);
col.innerHTML = "<input type=text readonly>";
col = row.insertCell(5);
col.innerHTML = "<INPUT type='button' value='埃' id=button1 name=button1 LANGUAGE=javascript onclick=\"return Delete_Row('row" + rowIndex + "')\">";
row.setAttribute("id", "row"+rowIndex);
row.setAttribute("name", "row"+rowIndex);
rowIndex++;
}
function getTo(obj){
var trobj = obj.parentElement.parentElement;
var qty = parseFloat(trobj.childNodes(2).childNodes(0).value);
var uprice = parseFloat(trobj.childNodes(3).childNodes(0).value);
if (qty>0 && uprice>0){
trobj.childNodes(4).childNodes(0).value = uprice*qty;
}}
function Delete_Row(rowTag)
{
var i = Table1.rows(rowTag).rowIndex;
Table1.deleteRow(i);
rowIndex--;
}
</script>
</head>
<body bgcolor="ffffff">
<form method="post" action="#" name="form1" onsubmit="return check();">
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#e6e6e6" id="Table1">
<tr bgcolor="#CCCCCC">
<td height="17" width="15%">祑ン摸</td>
<td width="41%">磞瓃</td>
<td width="21%" height="17">计秖</td>
<td width="8%" height="17">虫基</td>
<td> </td>
<td colspan="3" height="17" width="15%">巨</td>
</tr>
<SCRIPT LANGUAGE=javascript>
AddOneLine_onclick();
</SCRIPT>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="eeeeee">
<tr>
<td height="25" colspan="4"><font color="006699"></font>
</td>
<td colspan="3" height="25"> </td>
</tr> <tr>
<td width="42%">
<input type="button" name="add" value="穝糤兜ヘ" onClick="javascript:return AddOneLine_onclick();" >
</td>
<td width="58%">
<input type="submit" name="Submit" value="絋﹚">
<input type="reset" value="糶" name="reset">
<input type="button" name="Submit3" value="" onClick="javascript:location.href='selectProject.jsp?type=PO';">
</td>
</tr>
</table>
<input type="hidden" name="ProjectNo" value="YNK-200111095">
</form>
</body>
</html>
解决方案 »
- 麻烦大家介绍几种图像处理javascript
- 在javascript 中 cookie的简单问题
- js调用ASP问题
- document.forms['form的名字']获取值问题
- 日期问题
- js获取动态绑定的事件名
- 【求助】简单的加法问题!
- 正则表达式:如何匹配数值?(不是数字.如12.45是匹配的,而"13"不匹配)
- 简单问题散分:怎样在netscape 浏览器中得到DIV对象
- 这个级联菜单问题怎么解决?
- 禁用鼠标左键,
- 高分看看这段代码:<input type='hidden' name=abc value='a'><input type='hidden' name=abc value='b'>为什么提交后只有一个参数能传上
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="JavaScript">
function getTotal(price,count,obj)
{
var Total=price*count;
obj.value=Total;
}
</script>
<body>
单价:<input name="Price" type="text" id="Price" onBlur="getTotal(this.value,window.Count.value,window.Total)">
<br>
数量:<input name="Count" type="text" id="Count" onBlur="getTotal(window.Price.value,this.value,window.Total)">
<br>
小计:<input name="Total" type="text" id="Total">
</p>
</body>
</html>
这个 trobj.childNodes(2).childNodes(0).value 应该怎么来使用的?
多谢了,代码如下!!!<html>
<head>
<title>Purhcase Order 蹦潦虫</title>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<link rel="stylesheet" href="images/style.css" type="text/css">
<SCRIPT LANGUAGE=javascript>
<!--
var rowIndex = 0;
function AddOneLine_onclick()
{
var row = Table1.insertRow(Table1.rows.length);
var col = row.insertCell(0);
col.innerHTML = "<input name=Category id=Category size=20>";
col = row.insertCell(1);
col.innerHTML = " <textarea name=Description id=Description rows=2 cols=35></textarea>";
col = row.insertCell(2);
col.innerHTML = " <input type=text name=Qty id =Qty size=4 onchange='getTo(this);'> <input type=text name=UnitPrice id=UnitPrice size=10 onchange='getTo(this)'> <input type=text readonly>";
col = row.insertCell(3);
col.innerHTML = " <input type=text name=Qty1 id =Qty1 size=4 onchange='getTo(this);'> <input type=text name=UnitPrice1 id=UnitPrice1 size=10 onchange='getTo(this)'> <input type=text readonly>";
col = row.insertCell(4);
col.innerHTML = "";
col = row.insertCell(5);
col.innerHTML = "<INPUT type='button' value='埃' id=button1 name=button1 LANGUAGE=javascript onclick=\"return Delete_Row('row" + rowIndex + "')\">";
row.setAttribute("id", "row"+rowIndex);
row.setAttribute("name", "row"+rowIndex);
rowIndex++;
}
function getTo(obj){
var trobj = obj.parentElement.parentElement;
var qty = parseFloat(trobj.childNodes(2).childNodes(0).value);
var uprice = parseFloat(trobj.childNodes(3).childNodes(0).value);
if (qty>0 && uprice>0){
trobj.childNodes(4).childNodes(0).value = uprice*qty;
}}
function Delete_Row(rowTag)
{
var i = Table1.rows(rowTag).rowIndex;
Table1.deleteRow(i);
rowIndex--;
}
</script>
</head>
<body bgcolor="ffffff">
<form method="post" action="#" name="form1" onsubmit="return check();">
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#e6e6e6" id="Table1">
<tr bgcolor="#CCCCCC">
<td height="17" width="15%">祑ン摸</td>
<td width="41%">磞瓃</td>
<td width="21%" height="17">计秖</td>
<td width="8%" height="17">虫基</td>
<td> </td>
<td colspan="3" height="17" width="15%">巨</td>
</tr>
<SCRIPT LANGUAGE=javascript>
AddOneLine_onclick();
</SCRIPT>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="eeeeee">
<tr>
<td height="25" colspan="4"><font color="006699"></font>
</td>
<td colspan="3" height="25"> </td>
</tr> <tr>
<td width="42%">
<input type="button" name="add" value="穝糤兜ヘ" onClick="javascript:return AddOneLine_onclick();" >
</td>
<td width="58%">
<input type="submit" name="Submit" value="絋﹚">
<input type="reset" value="糶" name="reset">
</td>
</tr>
</table>
</form>
</body>
</html>