0
I want to create a form with a button +
, create more fields for the user to send as many forms as they want.
I tried this code, but to no avail:
var coluna = 1;
function plus() {
document.write('<button onclick="plus()">+</button><br><hr><br>');
document.write("<form action='teste.php' name='form'>");
coluna = coluna + 1;
botao = coluna - 1;
espacos = '<br><input type="text" name="assunto'+coluna+'"><br><br><textarea name="texto'+coluna+'" rows="3" cols="20"></textarea><br><br><button onclick="plus()">+</button><br><hr><br>';
document.write("teste");
document.write(coluna);
document.write(espacos);
document.write('<button onclick="document.form.submit()" id="submit'+coluna+'" name="rows" value="'+coluna+'">Enviar</button><br>');
//document.write('<input type="submit" id="submit'+coluna+'" name="submit'+coluna+'" value="enviar">');
document.getElementById('submit'+botao+'').style.visibility = "hidden";
document.write("</form>");
}