The execution of the force value in a small window is incorrect. The website on www.mredkj.comtutorialstableaddrow.html has an execution representation. I changed the code on the webpage & lt; form... the file name & gt; is used to create a new php file named getval_0403_02.php, but the write value cannot be displayed as it is on the Internet. Which of the following experts can tell you where to rewrite it. An error occurred while executing the force value in the small window.
Http://www.mredkj.com/tutorials/tableaddrow.html
The preceding website has an execution representation. I modified the code on the webpage. ,
Create a new php file named getval_0403_02.php
However, the write value cannot be displayed as on the Internet.
Which of the following experts can tell you where to rewrite it.
Thank you.
Script
// Last updated 2006-02-21
Function addRowToTable ()
{
Var tbl = document. getElementById ('tblsample ');
Var lastRow = tbl. rows. length;
// If there's no header row in the table, then iteration = lastRow + 1
Var iteration = lastRow;
Var row = tbl. insertRow (lastRow );
// Left cell
Var cellLeft = row. insertCell (0 );
Var textNode = document. createTextNode (iteration );
CellLeft. appendChild (textNode );
// Right cell
Var cellRight = row. insertCell (1 );
Var el = document. createElement ('input ');
El. type = 'text ';
El. name = 'txtrow' + iteration;
El. id = 'txtrow' + iteration;
El. size = 40;
El. onkeypress = keyPressTest;
CellRight. appendChild (el );
// Select cell
Var cellRightSel = row. insertCell (2 );
Var sel = document. createElement ('select ');
Sel. name = 'selrow' + iteration;
Sel. options [0] = new Option ('text zero ', 'value0 ');
Sel. options [1] = new Option ('text one', 'value1 ');
CellRightSel. appendChild (sel );
}
Function keyPressTest (e, obj)
{
Var validateChkb = document. getElementById ('chkvalidateonkeypress ');
If (validateChkb. checked ){
Var displayObj = document. getElementById ('spanoutput ');
Var key;
If (window. event ){
Key = window. event. keyCode;
}
Else if (e. which ){
Key = e. which;
}
Var objId;
If (obj! = Null ){
ObjId = obj. id;
} Else {
ObjId = this. id;
}
DisplayObj. innerHTML = objId + ':' + String. fromCharCode (key );
}
}
Function removeRowFromTable ()
{
Var tbl = document. getElementById ('tblsample ');
Var lastRow = tbl. rows. length;
If (lastRow> 2) tbl. deleteRow (lastRow-1 );
}
Function openInNewWindow (frm)
{
// Open a blank window
Var aWindow = window. open ('', 'tableaddrownewwindow ',
'Scrollbars = yes, menubar = yes, resizable = yes, toolbar = no, width = 400, height = 400 ');
// Set the target to the blank window
Frm.tar get = 'tableaddrownewwindow ';
// Submit
Frm. submit ();
}
Function validateRow (frm)
{
Var chkb = document. getElementById ('chkvalidate ');
If (chkb. checked ){
Var tbl = document. getElementById ('tblsample ');
Var lastRow = tbl. rows. length-1;
Var I;
For (I = 1; I <= lastRow; I ++ ){
Var aRow = document. getElementById ('txtrow' + I );
If (aRow. value. length <= 0 ){
Alert ('row' + I + 'is empty ');
Return;
}
}
}
OpenInNewWindow (frm );
}
Script
No title page