0
<div class="container">
<form method="POST" action='enviaMform.php'>
<div class="form-group">
<label for="nomeHost">Host que pretende monitorar:</label>
<input type="text" class="form-control" name="nomeHost">
</div>
<div class="form-group">
<label for="ipHost">Ip do host:</label>
<input type="text" max="12" name="ipHost" class="form-control"/>
</div>
<div class="form-group">
<label for="sistemaOperacional">Sistema operacional:</label>
<input type="text" class="form-control" name="sistemaOperacional">
</div>
<div class="form-group">
<label for="marcaModelo">Serviço hospedado no host:</label>
<input type="text" class="form-control" name="servicoHospedado">
</div>
<div class="form-group">
<label for="marcaModelo">Marca e modelo:</label>
<input type="text" class="form-control" name="marcaModelo">
</div>
<div class="form-group">
<label for="tpMonitoramento">Tipo de monitoramento:</label>
<div class="form-control">
<input type="checkbox" value="Simples" name="tpMonitoramento[]" /> <label for="simples">Simples</label>
</div><br>
<div class="form-control">
<input type="checkbox" value="ZabbixAgent" name="tpMonitoramento[]" /> <label for="Zabbix Agent">Zabbix Agent</label>
</div> <br>
<div class="form-control">
<input type="checkbox" value="MonitoramentoWeb" name="tpMonitoramento[]" /> <label for="simples">Monitoramento Web</label>
</div><br>
<div class="form-control">
<input type="checkbox" value="MonitoramentoODBC" name="tpMonitoramento[]" /> <label for="simples">Monitoramento ODBC</label>
</div> <br>
<button class="btn-block">Deseja monitorar mais algum host?</button>
<br>
<div align="center">
<input type="submit" value="Enviar" class="btn btn-info btn-block" style="color: #2196F3;"/>
</div>
</form>
</div>
I have this huge div and would like when the user clicks on "Do you want to monitor any more hosts?" It was possible to repeat it, but I have no idea how to do that.
you want to repeat this same code block?
– Alvaro Alves
your form Submit is handled before it runs? because if it happens refresh the page the content will get lost
– Alvaro Alves
Yes, I wish to repeat it
– Caio Frias
In this case, I have a registration function on the action page that saves this data in the database
– Caio Frias
I’m considering sending the user back to this page through a redirect link after saving the data in the database,without forcing you to every time you want to make a new record repeat the save and return process
– Caio Frias
via javascript, you can use ajax to save data, and manipulate the DOM via javascript.
– Alvaro Alves
something like this? https://codepen.io/alvaro-alves/pen/zJzpMG?editors=1011
– Alvaro Alves
Exactly that.
– Caio Frias
The rest of the data manipulation I can do later,
– Caio Frias