Good time of the day, forum users.
In html there is a table with two columns, I wrote js, to add a row to the table:
Js:
function func_table_without_forma() { var table = document.getElementById('tabl_one_without_forma'); var tr = document.createElement('tr'); tr.innerHTML = '<td><input name="edit_in_1" type="text" size="40"></td>\n\ <td><input name="edit_in_2" type="text" size="40"></td>'; var td = document.createElement('td'); tr.appendChild(td); table.appendChild(tr); }; Everything is working...
Then, I put a table (in html) in the form:
Js:
function func_table_with_forma() { var table = document.forma7.tabl_one_with_forma; var tr = document.createElement('tr'); tr.innerHTML = '<td><input name="edit_in_1" type="text" size="40"></td>\n\ <td><input name="edit_in_2" type="text" size="40"></td>'; var td = document.createElement('td'); tr.appendChild(td); table.appendChild(tr); }; and somewhere an error occurs here.
Where did I make a mistake?
Thanks for the answer...
PS
html:
<form name="forma7"> <table id="tabl_one_with_forma" width="100%" border="1" cellpadding="4"> <tbody> <tr> <td width="20%">111</td> <!-- height="59" --> <td width="50%">22772</td> </tr> </tbody> </table> <br><br> <button onclick="func_table_with_forma()"><b>with</b>_forma</button> </form>