I'm sending a field from my form to another page. In this page I need 2 images and 2x the id field that was received. But the received field only appears in the first image. Can you tell me where the error is?
Follow the form code:
<form action="menina.html" name="formul">
<input type="text" name="nome">
<br>
<br>
<input type="button" value="Menino" onclick="envia('menino.html')">
<br>
<input type="button" value="Menina" onclick="envia('menina.html')">
</form>
<script>
function envia(pag){
document.formul.action= pag
document.formul.submit()
}
</script>
This is the page code you are receiving
<html>
<head>
<script type="text/javascript">
function id( el ){
return document.getElementById( el );
}
/**
* @see http://www.netlobo.com/url_query_string_javascript.html
*/
function gup( name )
{
name = name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var regexS = "[\?&]"+name+"=([^]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
window.onload = function(){
id('nome').innerHTML = gup('nome').replace(/[+]/g,' ');;
}
</script>
<style>
#imagem {
width: 200px;
height 100px;
}
#texto {
position: absolute;
margin-top: -90px;
margin-left: 80px;
}
#imagem1 {
width: 200px;
height 100px;
}
#texto1 {
position: absolute;
margin-top: -60px;
margin-left: 300px;
}
</style>
</head>
<body>
<img id="imagem" src="Body bebe da titia.png"/>
<div id="texto"><p><strong id="nome"></strong></p> </div>
<img id="imagem1" src="Body principe da mamãe.png"/>
<div id="texto"><p><strong id="nome"></strong></p> </div>
</body>
</html>