I have a table with two rows: first row is header and second row is like this...
<tr>
<td><b>1</b></td>
<td><input type="date" id="dt" name="dt"></td>
<td><input type="time" id="tmStart" name="tmStart"></td>
<td><input type="time" id="tmEnd" name="tmEnd"></td>
<td><select id="ddlTrainType" name="ddlTrainType"><option>Select Training</option></select></td>
<td><input type="text" id="txtLoc" name="txtLoc"></td>
<td><select id="ddlProg" name="ddlProg"><option>Select Program</option></select></td>
<td><select id="ddlTrainMod" name="ddlTrainMod"><option>Select Module</option></select></td>
<td><select id="ddlTrainName" name="ddlTrainName"><option>Select Trainer</option></select></td>
<td><select id="ddlStat" name="ddlStat"><option>Pending</option><option>Completed</option><option>Cancelled</option></select></td>
</tr>
Note: all select tags drop-downs are populated from another google spreadsheet.
Now, on button click(button like add row), I want to append a similar row like above to this table.
Not only add a row, but also, in the end, let's say there are 5 rows in total and submit is clicked, then I want to store all 5 rows in a Google Spreadsheet.
Any ideas how to do this?
I already tried adding row with the help of code.gs file and reconstructing template using HtmlService.createTemplate. But this can only be used in doGet(e) I guess and cannot work with js button action.
Let's say we create such dynamic table, but even after that, how do we pass all the table data from javascript to code.gs file?