I'm trying to create a simple HTML project using the Struts framework.
I'm trying to add dynamically the tag <html:submit property="switchsubmit" ...... >
I have created a table and I gave it the id='idTable'
.
I have created a button which have the goal to add a new line in the table, this line contains a submit button created in tag based on Struts concept.
In the onClick()
function of the button, I wrote the code as below:
var table = document.getElementById('idTable');
var row = table .insertRow(0);
var cell = row.insertCell(0);
cell.style="border: 1px #376BAD solid;";
var submit = document.createElement("html:submit");
submit.property="switchsubmit";
submit.value="Add";
cell.appendChild(submit);
I've been adapted All about the struts-config.xml
.