Hi to all
I would like to create a dynamic button which adding new rows to my table and then sending it to PHP, I manage to create the JS function but after the rows have been added its not apearing the HTML code and by that I can't send it to PHP by form. here the code:
function Addline(ObjId,ItemAdd){
/*
*Addin One Line to the table
**/
var Elem = document.getElementById(ObjId);
var row = document.createElement("TR");
var td1 = document.createElement("TD");
var td2 = document.createElement("TD");
var Input = document.createElement("input");
var Items = document.getElementById(ItemAdd);
Global_i_table++;//Global var for the RowsCount
Input.setAttribute("name", "addition"+Global_i_table);
var RowName = prompt("Insert Field name");
while(RowName == "" || !isNaN(RowName)){
alert("Invalid name");
RowName = prompt("Insert Field name");
}
td1.appendChild(document.createTextNode(RowName));
td2.appendChild (Input);
row.appendChild(td1);
row.appendChild(td2);
Elem.appendChild(row);
Items.value = Global_i_table;
}
thanks