I have a project in which the form has to be dynamic, for example when filling name and age appears other fields like address and so on, I would like some hint how to do this with javascript / jquery.
<div id="main">
<form action="">
<p><strong>Nome: </strong><input type="text"></p>
<p><strong>Idade: </strong><input type="text"></p>
<p><strong>Estado: </strong><input type="text"></p>
<p><strong>Data de Nascimento: </strong><input type="date"></p>
<button id="proximo">Próximo</button><br>
</form>
</div><br>
<div id="teste"></div>
<script>
var btn = $('#proximo');
var teste = $('#teste');
btn.on('click', function() {
$(this).hide();
teste.load('parte2.html #teste2 p', completeFunction);
});
function completeFunction(responseText, textStatus, request) {
if(textStatus == 'error') {
teste.text('Ocorreu um erro: ' + request.status + ' ' + request.statusText);
}
}
</script>