01.
<script language=
"javascript"
>
02.
03.
function
CreateNewRow()
04.
{
05.
var
intLine = parseInt(document.frmMain.hdnMaxLine.value);
06.
intLine++;
07.
08.
var
theTable = document.getElementById(
"tbExp"
);
09.
var
newRow = theTable.insertRow(theTable.rows.length)
10.
newRow.id = newRow.uniqueID
11.
12.
var
newCell
13.
14.
15.
newCell = newRow.insertCell(0);
16.
newCell.id = newCell.uniqueID;
17.
newCell.setAttribute(
"className"
,
"css-name"
);
18.
newCell.innerHTML =
"<center><SELECT NAME=\"txtLevel_"
+intLine+
"\" ID=\"txtLevel_"
+intLine+
"\"></SELECT></center>"
;
19.
20.
21.
newCell = newRow.insertCell(1);
22.
newCell.id = newCell.uniqueID;
23.
newCell.setAttribute(
"className"
,
"css-name"
);
24.
newCell.innerHTML =
"<center><INPUT TYPE=\"TEXT\" SIZE=\"15\" NAME=\"txtItemRef_"
+intLine+
"\" ID=\"txtItemRef_"
+intLine+
"\" VALUE=\"\"></center>"
;
25.
26.
27.
newCell = newRow.insertCell(2);
28.
newCell.id = newCell.uniqueID;
29.
newCell.setAttribute(
"className"
,
"css-name"
);
30.
newCell.innerHTML =
"<center><SELECT style=\"width:300px;\" NAME=\"txtRelevantKey_"
+intLine+
"\" ID=\"txtRelevantKey_"
+intLine+
"\" ></SELECT></center>"
;
31.
32.
33.
newCell = newRow.insertCell(3);
34.
newCell.id = newCell.uniqueID;
35.
newCell.setAttribute(
"className"
,
"css-name"
);
36.
newCell.innerHTML =
"<center> <textarea rows =\"2\" cols =\"80\" NAME=\"txtDescription_"
+intLine+
"\" ID=\"txtDescription_"
+intLine+
"\" VALUE=\"\"> </textarea> </center>"
;
37.
38.
39.
40.
41.
CreateSelectOptionRelevantKey(
"txtRelevantKey_"
+intLine)
42.
fncCreateSelectOptionLevel(
"txtLevel_"
+intLine)
43.
44.
45.
document.frmMain.hdnMaxLine.value = intLine;
46.
}
47.
48.
function
fncCreateSelectOptionLevel(ele)
49.
{
50.
var
objSelect = document.getElementById(ele);
51.
52.
var
Item =
new
Option(
"+"
);
53.
objSelect.options[objSelect.length] = Item;
54.
55.
var
Item =
new
Option(
"++"
);
56.
objSelect.options[objSelect.length] = Item;
57.
}
58.
59.
60.
function
CreateSelectOptionRelevantKey(ele)
61.
{
62.
var
objSelect = document.getElementById(ele);
63.
var
Item =
new
Option(
""
,
""
);
64.
objSelect.options[objSelect.length] = Item;
65.
66.
<?php
67.
68.
$objQuery = mysql_query($strSQL);
69.
while
($objResult = mysql_fetch_array($objQuery))
70.
{ ?>
71.
72.
var
Item =
new
Option(
"<?php echo $objResult["
keyName
"];?>"
,
73.
"<?php echo $objResult["
keyID
"];?>"
);
74.
75.
objSelect.options[objSelect.length] = Item;
76.
<?php
77.
} ?>
78.
}
79.
80.
</script>