![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
21/05/2006, 13:04
|
| | Fecha de Ingreso: mayo-2006
Mensajes: 22
Antigüedad: 18 años, 8 meses Puntos: 0 | |
bien tengo un frame con 2 paginas, 1 k se llama dados, y otra comprobar. En la pagina comprobar tengo puesto los promp para introducir los nombres de tal forma
var nombre1 = prompt("Introduzca el nombre del Jugador 1:","")
var nombre2 = prompt("Introduzca el nombre del Jugador 2:","")
bien pues el nombre k yo introduzca ay, y k esta guardado en la var nombreX, kiero k aprezca en la pagina comprobar (pongo el codigo entero): <HTML>
<HEAD>
<SCRIPT>
function comprobar()
{
var mi1,mi2,mi3,mi4,mi5,mi6,mi7,mi8,mi9,mi10,mi11,mi12 ,total1,total2;
mi1=parseInt(document.form2.mio1.value);
mi2=parseInt(document.form2.mio2.value);
mi3=parseInt(document.form2.mio3.value);
mi4=parseInt(document.form2.mio4.value);
mi5=parseInt(document.form2.mio5.value);
mi6=parseInt(document.form2.mio6.value);
mi7=parseInt(document.form2.mio7.value);
mi8=parseInt(document.form2.mio8.value);
mi9=parseInt(document.form2.mio9.value);
mi10=parseInt(document.form2.mio10.value);
mi11=parseInt(document.form2.mio11.value);
mi12=parseInt(document.form2.mio12.value);
mi1=mi1*6;
mi2=mi2*5;
mi3=mi3*4;
mi4=mi4*3;
mi5=mi5*2;
mi6=mi6;
mi7=mi7*6;
mi8=mi8*5;
mi9=mi9*4;
mi10=mi10*3;
mi11=mi11*2;
mi12=mi12;
total1=mi1+mi2+mi3+mi4+mi5+mi6;
total2=mi7+mi8+mi9+mi10+mi11+mi12;
if(total1==total2)
{
alert('Empate');
}
if(total1<total2)
{
alert('Gana jugador2');
}
if(total1>total2)
{
alert('Gana jugador1');
}
}
</script>
</HEAD>
<BODY id="body1" style="background:green">
<form name="form2">
<center> Jugador1: & nbsp;   ; Jugador2:
<p>
<h3>1</h3>
<input type="text" name="mio1">
<input type="text" name="mio7">
</p>
<p>
<h3>2</h3>
<input type="text" name="mio2">
<input type="text" name="mio8">
</p>
<p>
<h3>3</h3>
<input type="text" name="mio3">
<input type="text" name="mio9">
</p>
<p>
<h3>4</h3>
<input type="text" name="mio4">
<input type="text" name="mio10">
</p>
<p>
<h3>5</h3>
<input type="text" name="mio5">
<input type="text" name="mio11">
</p>
<p>
<h3>6</h3>
<input type="text" name="mio6">
<input type="text" name="mio12">
</p>
<input type="button" name="Submit" value="comprobar" OnClick="comprobar()">
</center>
</p>
</form>
<img src="dados2.gif" height="75" width="100" align="right">
<img src="dados3.jpg" height="75" width="100" align="left">
<center>
<input type="button" onclick="location.reload()" value="Resetear">
</center>
</BODY>
</HTML>
en laparte k esta en cursiva, y subrayado, en vez de aparecer Jugador 1 y jugador 2, kiero k aparezcan los nombres k e introducio en los promp k estan en el otro frame, sabes como acerlo?? |