Foros del Web » Programando para Internet » Javascript »

me dan una mano con esto

Estas en el tema de me dan una mano con esto en el foro de Javascript en Foros del Web. necesito cargar tres nombre y tres edad y que me salga en nombre de la edad del mayor yo hice esto me no me sale ...
  #1 (permalink)  
Antiguo 17/06/2013, 13:18
 
Fecha de Ingreso: mayo-2013
Mensajes: 4
Antigüedad: 10 años, 11 meses
Puntos: 0
me dan una mano con esto

necesito cargar tres nombre y tres edad y que me salga en nombre de la edad del mayor yo hice esto me no me sale la formula si alguien me puede dar una mano






<html>
<head>
<script language="JavaScript">
/*
Fecha y Hora By Chivi
*/

/* Coeminza el script del Reloj */

function actualizaReloj(){

/* Capturamos la Hora, los minutos y los segundos */
marcacion = new Date()

/* Capturamos la Hora */
Hora = marcacion.getHours()

/* Capturamos los Minutos */
Minutos = marcacion.getMinutes()

/* Capturamos los Segundos */
Segundos = marcacion.getSeconds()

/* Si la Hora, los Minutos o los Segundos
Son Menores o igual a 9, le añadimos un 0 */

if (Hora<=9)
Hora = "0" + Hora

if (Minutos<=9)
Minutos = "0" + Minutos

if (Segundos<=9)
Segundos = "0" + Segundos

/* Termina el Script del Reloj */


/* Coemienza eñ Script de la Fecha */

var Dia = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo");
var Mes = new Array("Enero","Febrero","Marzo","Abril","Mayo","Ju nio","Julio","Agosto","Septiembre","Octubre","Novi embre","Diciembre");
var Hoy = new Date();
var Anio = Hoy.getFullYear();
var Fecha = "Hoy es " + Dia[Hoy.getDay()] + ", " + Hoy.getDate() + " de " + Mes[Hoy.getMonth()] + " de " + Anio + ", a las ";

/* Termina el script de la Fecha */


/* Creamos 4 variables para darle formato a nuestro Script */
var Inicio, Script, Final, Total

/*En Inicio le indicamos un color de fuente y un tamaño */
Inicio = "<font size=3 color=black>"

/* En Reloj le indicamos la Hora, los Minutos y los Segundos */
Script = Fecha + Hora + ":" + Minutos + ":" + Segundos

/* En final cerramos el tag de la fuente */
Final = "</font>"

/* En total Finalizamos el Reloj uniendo las variables */
Total = Inicio + Script + Final

/* Capturamos una celda para mostrar el Reloj */
document.getElementById('Fecha_Reloj').innerHTML = Total

/* Indicamos que nos refresque el Reloj cada 1 segundo */
setTimeout("actualizaReloj()",1000)
}
</script>

<body onload="actualizaReloj()">

<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td id="Fecha_Reloj"></td>
</tr><br/>
<script language="javascript" type="text/javascript">
function color(n) {
return "0123456789ABCDEF".charAt(parseInt(n / 16)) + "0123456789ABCDEF".charAt(parseInt(n % 16));
}

function ini() {
var elFondo = document.getElementById("fondo").style;
var ancho = document.body.clientWidth;
var alto = document.body.clientHeight;
elFondo.width = ancho;
elFondo.height = alto;
var altoCelda = alto / 256;
var tabla = "<table cellpadding=0 cellspacing=0 width=100% height=100%>";
for (var i = 255; i >= 0; i --)
tabla += "<tr><td width=100% height=" + altoCelda + " style='background-color: #FF" + color(i) + "00' ></td></tr>"
tabla += "</table>";
document.getElementById("fondo").innerHTML = tabla;
}
</script>
</head>
<body style="margin:0" onresize=ini() onload="ini()">
<div style="position: relative">
<div id=fondo style="position:absolute; top:0; left:0;"></div>
<div id=general style="position:absolute; top:0; left:0;">
<table align="center" border=10 >
<tr>
<td >
<script languaje="JavaScript">
function calcularmayoredad()
{
//Escribir en la misma línea las dos lineas siguientes.

var primernombre = parseInt (document.form1.D1.options
[document.form1.D1.selectedIndex].value);<br/>
var primeraedad = parseInt (document.form1.D1a.options
[document.form1.D1a.selectedIndex].value);<br/>

var segundonombre = parseInt (document.form1.D2.options
[document.form1.D2.selectedIndex].value); <br/>
var segundaedad = parseInt (document.form1.D2a.options
[document.form1.D2a.selectedIndex].value); <br/>

var tercernombre = parseInt (document.form1.D3.options
[document.form1.D3.selectedIndex].value); <br/>
var terceraedad = parseInt (document.form1.D3a.options
[document.form1.D3a.selectedIndex].value);

document.form1.T1.value=primernombre+segundonombre +tercernombre; <br/>
document.form1.T2.value=primeraedad+segundaedad+te rceraedad;
}
</script>
<form name="form1"><br/><br/>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td onmouseover="this.style.background='red'" onmouseout="this.style.background='white'">
<p>PRIMER NOMBRE:
<input type="text" name="T1" size="20" >
EDAD:
<input type="text" name="T2" size="1">
</td>
</tr>
</table><br/><br/>

<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td onmouseover="this.style.background='red'" onmouseout="this.style.background='white'">

<p>SEGUNDO NOMBRE:
<input type="text" name="T1" size="17">
EDAD:
<input type="text" name="T2" size="1">
</td>
</tr>
</table><br/><br/>

<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td onmouseover="this.style.background='red'" onmouseout="this.style.background='white'">

<p>TERCER NOMBRE:
<input type="text" name="T1" size="20">
EDAD:
<input type="text" name="T2" size="1">
</td>
</tr>
</table>
<script language="javascript" type="text/javascript">
function change()
{
re="rgb("+Math.round(Math.random()*256)+","+Math.r ound(Math.random()*256)+","+Math.round(Math.random ()*256)+")"
text.style.color=re;
}
setInterval(change,1000);
</script><br/>

<p><input type="button" value="Nombre de Mayor Edad" name="B1"
onClick="calcularmayoredadca()"> <input type="text" name="T1+T2" size="25"> </p>
<p id="text" align="center"> ALUMNO: VILLARREAL.IVAN.</p>

</td><br/>

</table>
</body>
</html>

Etiquetas: html, input, mano, select
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:28.