0
What I have to do seems simple, but I’m not getting it.
I need to fill out a form and when clicking the save button it should show another page with this same data that I registered on the previous page. I do this only with HTML and Javascript?
I’m using the GET method.
Below follow codes
<html>
<head>
<title>Exercício 01 - Exibição de Formulário</title>
</head>
<body>
<div>
<h1>*** Formulário de Cadastro ***</h1>
<hr />
</div>
<p><i><h3>Todos os campos com * são de preenchimento obrigatório!</h3></i></p>
<form action="exe01 - informacoes Cadastrais.html" method="GET" onsubmit="javascript: return salvarDados()">
<label><b>Nome:</b></label>
<input type="text" name="txtNome" value="" /> *
<br /> <br />
<label><b>Sobrenome:</b></label>
<input type="text" name="txtSobrenome" value="" /> *
<br /><br />
<label><b>CPF:</b></label>
<input type="text" name="txtCpf" value="" /> *
<br /> <br />
<label><b>Telefone:</b></label>
<input type="text" name="txtTelefone" value="" /> *
<br /> <br />
<label><b>E-mail:</b></label>
<input type="text" name="txtEmail" value=""> *
<br /> <br />
<input type="submit" value="Salvar" />
</form>
<!-- CÓDIGO JAVASCRIPT -->
<script>
function salvarDados() {
var nome = document.getElementById("txtNome").value;
var sobrenome = document.getElementById("txtSobrenome").value;
var cpf = document.getElementById("txtCpf").value;
var telefone = document.getElementById("txtTelefone").value;
var email = document.getElementById("txtEmail").value;
var dados = "Nome: " + nome + "Sobrenome: " + sobrenome +
"CPF: " + cpf + "Telefone: " + telefone + "E-mail: " + email;
return true;
}
</script>
</body>
</html>
I believe you have to use PHP
– Italo Rodrigo
opa, right. I’ll try tbm, vlw
– user89080