01.
function
CreateNewRow()
02.
{
03.
var
intLine = parseInt(document.frmMain.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
item1 = 1
11.
var
newCell
12.
13.
14.
15.
newCell = newRow.insertCell(0)
16.
newCell.id = newCell.uniqueID
17.
newCell.setAttribute(
"type"
,
"text"
);
18.
newCell.style.cssText=
'text-align:center;'
;
19.
newCell.innerHTML = intLine;
20.
21.
22.
23.
newCell = newRow.insertCell(1)
24.
newCell.id = newCell.uniqueID
25.
newCell.setAttribute(
"type"
,
"text"
);
26.
newCell.setAttribute(
"name"
,
"MatchQuestion"
+intLine);
27.
newCell.innerHTML =
"<INPUT TYPE=\"TEXT\" SIZE=\"25\" CLASS=\"form-control\" NAME=\"MatchQuestion"
+intLine+
"\" VALUE=\"\" placeholder=\"คำถามที่"
+intLine+
"\">"
28.
29.
30.
31.
newCell = newRow.insertCell(2)
32.
newCell.id = newCell.uniqueID
33.
newCell.setAttribute(
"type"
,
"text"
);
34.
newCell.setAttribute(
"name"
,
"MatchAnswer"
+intLine);
35.
newCell.innerHTML =
"<INPUT TYPE=\"TEXT\" SIZE=\"25\" CLASS=\"form-control\" NAME=\"MatchAnswer"
+intLine+
"\" VALUE=\"\" placeholder=\"คำตอบที่"
+intLine+
"\">"
36.
37.
38.
39.
newCell = newRow.insertCell(3)
40.
newCell.id = newCell.uniqueID
41.
newCell.setAttribute(
"name"
,
"MatchMark"
+intLine);
42.
newCell.innerHTML =
"<input type=\"number\" class=\"form-control\" id=\"Mark\" placeholder=\"กรอกคะแนน\" NAME=\"MatchMark"
+intLine+
"\" min=\"-100\" max=\"100\" step=\"0.5\">"
43.
44.
document.frmMain.hdnMaxLine.value = intLine;
45.
}