01.
function
CreateNewRow()
02.
{
03.
var
intLine = parseInt(document.getElementById(
'hdnMaxLine'
).value);
04.
intLine++;
05.
06.
var
theTable = document.all.tbExp
07.
var
newRow = theTable.insertRow(theTable.rows.length)
08.
newRow.id = newRow.uniqueID
09.
10.
var
newCell
11.
12.
13.
newCell = newRow.insertCell(0);
14.
newCell.id = newCell.uniqueID;
15.
newCell.setAttribute(
"className"
,
"css-name"
);
16.
newCell.innerHTML =
"<center><SELECT NAME=\"Column1_"
+intLine+
"\" ID=\"Column1_"
+intLine+
"\"></SELECT></center>"
;
17.
18.
19.
newCell = newRow.insertCell(1);
20.
newCell.id = newCell.uniqueID;
21.
newCell.setAttribute(
"className"
,
"fieldcell"
);
22.
newCell.innerHTML =
"<center><INPUT TYPE=\"TEXT\" SIZE=\"5\" NAME=\"Column2_"
+intLine+
"\" ID=\"Column2_"
+intLine+
"\" VALUE=\"\"></center>"
;
23.
24.
25.
newCell = newRow.insertCell(2);
26.
newCell.id = newCell.uniqueID;
27.
newCell.setAttribute(
"className"
,
"moneycell"
);
28.
newCell.innerHTML =
"<center><INPUT TYPE=\"TEXT\" SIZE=\"5\" NAME=\"Column3_"
+intLine+
"\" ID=\"Column3_"
+intLine+
"\" OnKeyUp=\"fnccal1();\" VALUE=\"\"></center>"
;
29.
30.
31.
newCell = newRow.insertCell(3);
32.
newCell.id = newCell.uniqueID;
33.
newCell.setAttribute(
"className"
,
"moneycell"
);
34.
newCell.innerHTML =
"<center><INPUT TYPE=\"TEXT\" SIZE=\"5\" NAME=\"Column4_"
+intLine+
"\" ID=\"Column4_"
+intLine+
"\" OnKeyUp=\"fnccal2();\" VALUE=\"\"></center>"
;
35.
36.
37.
document.getElementById(
'hdnMaxLine'
).value = intLine
38.
}
39.
40.
function
RemoveRow()
41.
{
42.
var
intLine = parseInt(document.getElementById(
'hdnMaxLine'
).value);
43.
if
(parseInt(intLine) > 0)
44.
{
45.
theTable = (document.all) ? document.all.tbExp :
46.
document.getElementById(
"tbExp"
)
47.
theTableBody = theTable.tBodies[0];
48.
theTableBody.deleteRow(intLine);
49.
intLine--;
50.
document.getElementById(
'hdnMaxLine'
).value = intLine
51.
}
52.
}
53.
54.
function
GenerateRow()
55.
{
56.
var
intRows = parseInt(document.getElementById(
'txtCount'
).value);
57.
for
(i=0;i<intRows;i++)
58.
{
59.
CreateNewRow();
60.
}
61.
}