good Evening friends, i'm trying to make a simple javaScript code that send the inputs information to another html page, and its not working for me.
i've 2 pages page1.html that contains the inputs :
<html>
<head>
<link href="smi.css" rel="stylesheet" type="text/css"> </head>
<body>
<form action="page2.html" method="post">
Tape your firstname: <input type="text" name="nom"><br>
Tape your lastname: <input type="text" name="prenom"><br>
<button type="submit">gènèrer</button>
</form>
</body>
</html>
and the page2.html :
<html>
<head>
<link href="smi.css" rel="stylesheet" type="text/css"> </head>
<body>
<p id="zone" ></p>
<script src="page2.js" type="text/JavaScript"> </script>
</body>
</html>
this is my script :
var x = getUrlVars()["nom"];
var y = getUrlVars()["prenom"];
var w = getUrlVars()["Tel"];
var z = "bonjour " +x+" "+y+"votre Tel est : " +w;
document.getElementById("zone").innerText() = z;
function getUrlVars(){
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(m,key,value){
vars[key] = value;
});
return vars;
}
i hope if u can help me plz.
epresstheNode.jsframework. For this type of tasks u need some backend code, usually it is handled by a server ( your computer con do this work too ), google it u will find many usefull things