好像明白你的意思了我想第一步,先要并确数据结构设计记录: ID 工序ID 相应特别提示ID相应特别提示: ID 记录ID 特别提示小类ID特别提示小类 ID 名称工序: ID 特别提示小类ID
再看看这样一些代码吧!!!!!!!!<html> <head> <title>ネ玻</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 = "<SELECT NAME=\"\"><option value=''>Please select</option><option value=''>苝ふ</option><option value=''>筿玲</option></SELECT>"; 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='chknum(this);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 chknum(obj){ var trobj = obj.parentElement.parentElement; var curRowIdx = trobj.rowIndex;
if (curRowIdx>1){ var tbobj = trobj.parentElement.parentElement; var curValue = parseFloat(obj.value); var preValue = parseFloat(tbobj.childNodes(0).childNodes(curRowIdx-1).childNodes(2).childNodes(0).value); if (curValue>=preValue) { alert("number is too much"); obj.value=""; } } } function getTo(obj){ var trobj = obj.parentElement.parentElement;
给你写了一个,累死了,不给分,跟你没完:)<html> <head> <title>生產工序</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 insertGroup(oThis) { for (var i=0;i<tblGroup.children.length;i++) { if (tblGroup.children[i].innerHTML.indexOf(oThis.options[oThis.selectedIndex].innerText)>0) { oThis.parentElement.parentElement.cells[1].innerHTML = tblGroup.children[i].children[1].innerHTML; break; } } } function AddOneLine_onclick() { var row = Table1.insertRow(Table1.rows.length); var col = row.insertCell(0); col.innerHTML = "<SELECT NAME=\"\" onchange=\"insertGroup(this)\"><option value=''>Please select</option><option value=''>鑽孔</option><option value=''>電鍍</option></SELECT>"; 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='chknum(this);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 chknum(obj){ var trobj = obj.parentElement.parentElement; var curRowIdx = trobj.rowIndex;
if (curRowIdx>1){ var tbobj = trobj.parentElement.parentElement; var curValue = parseFloat(obj.value); var preValue = parseFloat(tbobj.childNodes(0).childNodes(curRowIdx-1).childNodes(2).childNodes(0).value); if (curValue>=preValue) { alert("number is too much"); obj.value=""; } } } function getTo(obj){ var trobj = obj.parentElement.parentElement;
ID
工序ID
相应特别提示ID相应特别提示:
ID
记录ID
特别提示小类ID特别提示小类
ID
名称工序:
ID
特别提示小类ID
<head>
<title>ネ玻</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 = "<SELECT NAME=\"\"><option value=''>Please select</option><option value=''>苝ふ</option><option value=''>筿玲</option></SELECT>";
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='chknum(this);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 chknum(obj){
var trobj = obj.parentElement.parentElement;
var curRowIdx = trobj.rowIndex;
if (curRowIdx>1){
var tbobj = trobj.parentElement.parentElement;
var curValue = parseFloat(obj.value);
var preValue = parseFloat(tbobj.childNodes(0).childNodes(curRowIdx-1).childNodes(2).childNodes(0).value);
if (curValue>=preValue) {
alert("number is too much");
obj.value="";
}
}
}
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>
<input type="hidden" name="ProjectNo" value="YNK-200111095">
程狦琌硂妓 <table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="14%"></td>
<td width="55%">疭ボの璶―</td>
<td width="8%">计秖</td>
<td width="12%">ら戳</td>
<td width="11%"> </td>
</tr>
<tr>
<td width="14%">
<select name="select">
<option selected>苝ふ</option>
</select>
</td>
<td width="55%"> 竚
<input type="text" name="textfield4">
瞏
<input type="text" name="textfield5">
</td>
<td width="8%">
<input type="text" name="textfield22" size="6">
</td>
<td width="12%">
<input type="text" name="textfield32" size="10">
</td>
<td width="11%"> </td>
</tr>
<tr>
<td width="14%">
<select name="select2">
<option selected>筿玲</option>
</select>
</td>
<td width="55%">玴
<input type="text" name="textfield">
<input type="checkbox" name="checkbox" value="checkbox">
筿
<input type="checkbox" name="checkbox2" value="checkbox">
筿奎</td>
<td width="8%">
<input type="text" name="textfield2" size="6">
</td>
<td width="12%">
<input type="text" name="textfield3" size="10">
</td>
<td width="11%"> </td>
</tr>
</table>
</form>
</body>
</html>
<head>
<title>生產工序</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 insertGroup(oThis)
{
for (var i=0;i<tblGroup.children.length;i++)
{
if (tblGroup.children[i].innerHTML.indexOf(oThis.options[oThis.selectedIndex].innerText)>0)
{
oThis.parentElement.parentElement.cells[1].innerHTML = tblGroup.children[i].children[1].innerHTML;
break;
}
}
}
function AddOneLine_onclick()
{
var row = Table1.insertRow(Table1.rows.length);
var col = row.insertCell(0);
col.innerHTML = "<SELECT NAME=\"\" onchange=\"insertGroup(this)\"><option value=''>Please select</option><option value=''>鑽孔</option><option value=''>電鍍</option></SELECT>";
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='chknum(this);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 chknum(obj){
var trobj = obj.parentElement.parentElement;
var curRowIdx = trobj.rowIndex;
if (curRowIdx>1){
var tbobj = trobj.parentElement.parentElement;
var curValue = parseFloat(obj.value);
var preValue = parseFloat(tbobj.childNodes(0).childNodes(curRowIdx-1).childNodes(2).childNodes(0).value);
if (curValue>=preValue) {
alert("number is too much");
obj.value="";
}
}
}
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>
<input type="hidden" name="ProjectNo" value="YNK-200111095">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<th>
<td width="14%">工序</td>
<td width="55%">特別指示以及要求</td>
<td width="8%">數量</td>
<td width="12%">日期</td>
<td width="11%"> </td>
</th>
<tbody id=tblGroup>
<tr>
<td width="14%">
<select name="select">
<option selected>鑽孔</option>
</select>
</td>
<td width="55%"> 位置
<input type="text" name="textfield4">
深度
<input type="text" name="textfield5">
</td>
<td width="8%">
<input type="text" name="textfield22" size="6">
</td>
<td width="12%">
<input type="text" name="textfield32" size="10">
</td>
<td width="11%"> </td>
</tr>
<tr>
<td width="14%">
<select name="select2">
<option selected>電鍍</option>
</select>
</td>
<td width="55%">厚度
<input type="text" name="textfield">
<input type="checkbox" name="checkbox" value="checkbox">
電金
<input type="checkbox" name="checkbox2" value="checkbox">
電錫</td>
<td width="8%">
<input type="text" name="textfield2" size="6">
</td>
<td width="12%">
<input type="text" name="textfield3" size="10">
</td>
<td width="11%"> </td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
但是我有20多个工序,每个工序的"特别指示跟要求"都不同的!!!应该怎么来处理??不是单单两个工序的,请问有什么好办法???
web service 具体怎么用???多谢指教,十分感激!!!分数一定会给!!
<ids>后台根据这个ID查询数据</ids>
</xml>
<script>
var obj = new ActiveXObject("MSXML.XMLHTTP")
obj.async = false;
obj.open("POST", "根据数据库信息生成我要的HTML.htm");
obj.send(oData.XMLDocument);
alert("把这段代码插入到想要的cell中: " + obj.responseText )
</script>