0
I have a project where the form has to be dynamic, for example when filling name and age appears other fields like the address and so on, I would like some tip on 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>
Here on the site you have to put the code you have already done along with the question to get more help!
– LeAndrade
Welcome Thi100, please read these posts to help you with your next questions https://answall.com/help/mcve and if any answers have resolved your issue mark it as accepted, see how and why at https://pt.meta.stackoverflow.com/questions/1078/como-e-por-que-accepta-Reply/1079#1079
– user60252