
Mostrar el nombre de la persona mayor
Publicado por Bryan (6 intervenciones) el 11/11/2016 13:42:50
hola necesito un poco de ayuda.. tengo este problema solicitar tres nombres en un formulario con sus respectivas edades y al presionar un botón mostrar en otro text el nombre del mayor.
puedo hacer todo pero cuando preciono el boton no me muestra nada.. si alguien me puede indicar que estoy haciendo mal.. les pongo el codigo..
puedo hacer todo pero cuando preciono el boton no me muestra nada.. si alguien me puede indicar que estoy haciendo mal.. les pongo el codigo..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<head>
</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()
{
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>
</td><br/>
</table>
</body>
</html>
Valora esta pregunta


0