add new html table, under the existing table with javascript

vbteamsucks

New Member
I have an html table and a javascript code which adds a new table under this by pressing the "add new table" button. The problem is that when I am refressing the page, the table that just added disappeared. How can I make it to remain after added, when I am refressing the page?\[code\]<table border="0" style="margin: auto; "><td width="60%" ><fieldset style="width:530px; padding-left:5px; background-color:white " ><INPUT type="button" value="http://stackoverflow.com/questions/15642059/Add new Table" onclick="addRow('dataTable')" />School/University/College*</br><input name="school_1" type="text" size="73"/></br></br>Field of Study</br><input name="field_1" type="text" size="73"/></br></br>Specialized subjects</br><input name="specialized_subject_1" type="text" size="73" /></br></br>Degree</br><input name="degree_1" type="text" size="73"/></br></br>Grade</br><input name="grade_1" type="text" size="73" /></br></br></br> Attended from:&nbsp;<select name="month_1_1"> <option value="http://stackoverflow.com/questions/15642059/"> EMPTY </option> <option value="http://stackoverflow.com/questions/15642059/January">January</option> </select> <select id="year_1_1" name="year_1_1"> <option value="http://stackoverflow.com/questions/15642059/"> EMPTY </option> <option value="http://stackoverflow.com/questions/15642059/2009">2009</option> </select>&nbsp;&nbsp;&nbsp;&nbsp; Until:&nbsp;<select name="month_1_2"> <option value="http://stackoverflow.com/questions/15642059/"> EMPTY </option> <option value="http://stackoverflow.com/questions/15642059/January">January</option> </select> <select name="year_1_2"> <option value="http://stackoverflow.com/questions/15642059/"> EMPTY </option> <option value="http://stackoverflow.com/questions/15642059/2009">2009</option> </select>&nbsp;&nbsp; </h2></font></fieldset></td></table>\[/code\]and this is the javascript code:\[code\] <SCRIPT language="javascript"> function addRow(tableID) { var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var colCount = table.rows[0].cells.length; for(var i=0; i<colCount; i++) { var newcell = row.insertCell(i); newcell.innerHTML = table.rows[0].cells.innerHTML; //alert(newcell.childNodes); switch(newcell.childNodes[0].type) { case "text": newcell.childNodes[0].valuehttp://stackoverflow.com/questions/15642059/= ""; break; case "select-one": newcell.childNodes[0].selectedIndex = 0; break; } } }</SCRIPT>\[/code\]
 
Back
Top