0
Guys I need to make sure that when the user clicks on the "Send" button automatically it is redirected to another page with all the data entered by the user as: e-mail, password, name, etc(using "get" method").
It turns out that I tried to do and only manage to redirect to the other page, being the same empty.
Follow my HTML file:
<form action="dados.html" method="post">
<input type="text" id="cNome" name="tNome" size="20" maxlength="20" placeholder=" Digite Seu Nome"/><br><br>
<input type="email" id"cEmail" name="tEmail" size="30" maxlength="30" placeholder=" Digite Seu E-mail"/><br><br>
<input type="date" id="cData" name="tData"/><br><br><br>
Filme:
<select id="cFilmes">
<option >Transformers: O Último Cavaleiro</option>
<option >Planeta dos Macacos: A Guerra</option>
<option >Velozes e Furiosos 8</option>
<option >Alien: Paradise Lost</option>
<option >Carros 3</option>
<option >Logan</option>
</select><br><br><br><br><br>
<input type="submit" value="Enviar"/>
<input type="reset" value="Cancelar"/>
</form>
Below is the redirect page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dados</title>
<script type="text/javascript">
var nome, email, data, filme;
nome = document.getElementById("cNome").value;
email = document.getElementById("cEmail").value;
data = document.getElementById("cData").value;
filme = document.getElementById("cFilmes").value;
document.write("Obrigado, " +nome+ "\nSegue abaixo seus dados:\nE-mail: " +email+ "\nData de nascimento: \n" +data+ "Filme escolhido: " +filme)
</script>
</head>
<body>
</body>
</html>
I’m beginner in this area and I’ve tried to see several tutorial by youtube but most are using HTML together with PHP, JQUERY, JAVA, languages that I don’t have the minimum knowledge, I want it to be only using HTML and JS.I took a look at other questions and it already has but I want to ask this if there is a simpler way to put it because I’m a beginner did not understand very well with the other questions, but if there’s no other simpler way to explain as detailed as possible, I’d be most grateful.
You want to traffic information from one page to another using javascript only?
– MarceloBoni
Using HTML and JS, I don’t know if it’s possible with just one of the two.
– Lone Tonberry
In theory it is not ideal, but it has how to do yes
– MarceloBoni
As I am starting now I will only learn other languages later, please show me this method.
– Lone Tonberry