<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="http-equiv" content="Content-type: text/html; charset=UTF-8"/>
<script type="text/javascript">
function calcular_edad(opt1,opt2,opt3) {
var dia, mes, anyo
if (opt1 == "") {dia = document.forma28.dia.options[document.forma28.dia.selectedIndex].value;} else { dia = opt1;}
if (opt2 == "") {mes = document.forma28.mes.options[document.forma28.mes.selectedIndex].value;} else { mes = opt2;}
if (opt3 == "") {anyo = document.forma28.ano.options[document.forma28.ano.selectedIndex].value;} else { anyo = opt3;}
alert("Dia " +dia+ " Mes " +mes+ " Anyo " +anyo)
var nacimiento =new Date(anyo, mes, dia)
hoy = new Date()
var cuantos_dias =1000*60*60*24*365
document.getElementById("edad").value = (Math.ceil((hoy.getTime()-nacimiento.getTime())/(cuantos_dias))-1);
}
</script>
</head>
<body>
<center> REGISTRO </center>
<center>
<form name="forma28" action="index.php?mod=jugadores&pag=guardar" id="forma28" method="post" onSubmit="return validar_jugador(this)" >
<table border="0" align="center" id="gradient-style">
<tr>
<td> Fecha de Nacimiento </td>
<td> <select name="dia" size="5" onchange="calcular_edad(this.options[this.selectedIndex].value,'','');">
<option value=""> DÍA</option>
<option value="1" selected> 1</option>
<option value="2"> 2</option>
<option value="3"> 3</option>
<option value="4"> 4</option>
<option value="5"> 5</option>
<option value="6"> 6</option>
<option value="7"> 7</option>
<option value="8"> 8</option>
<option value="9"> 9</option>
<option value="10"> 10</option>
<option value="11"> 11</option>
<option value="12"> 12</option>
<option value="13"> 13</option>
<option value="14"> 14</option>
<option value="15"> 15</option>
<option value="16"> 16</option>
<option value="17"> 17</option>
<option value="18"> 18</option>
<option value="19"> 19</option>
<option value="20"> 20</option>
<option value="21"> 21</option>
<option value="22"> 22</option>
<option value="23"> 23</option>
<option value="24"> 24</option>
<option value="25"> 25</option>
<option value="26"> 26</option>
<option value="27"> 27</option>
<option value="28"> 28</option>
<option value="29"> 29</option>
<option value="30"> 30</option>
</select>
<select name="mes" size="5" onchange="calcular_edad('',this.options[this.selectedIndex].value,'');">
<option value=""> MES </option>
<option value="0" selected> Enero</option>
<option value="1"> Febrero</option>
<option value="2"> Marzo</option>
<option value="3"> Abril</option>
<option value="4"> Mayo</option>
<option value="5"> Junio</option>
<option value="6"> Julio</option>
<option value="7"> Agosto</option>
<option value="8"> Septiembre</option>
<option value="9"> Octubre</option>
<option value="10"> Noviembre</option>
<option value="11"> Diciembre</option>
</select>
<select name="ano" size="5" onchange="calcular_edad('','',this.options[this.selectedIndex].value);">
<option value=""> AÑO</option>
<option value="74" selected> 1974</option>
<option value="75"> 1975</option>
<option value="76"> 1976</option>
<option value="77"> 1977</option>
<option value="78"> 1978</option>
<option value="79"> 1979</option>
<option value="80"> 1980</option>
<option value="81"> 1981</option>
<option value="82"> 1982</option>
<option value="83"> 1983</option>
<option value="84"> 1984</option>
<option value="85"> 1985</option>
<option value="86"> 1986</option>
<option value="87"> 1987</option>
<option value="88"> 1988</option>
<option value="89"> 1989</option>
<option value="90"> 1990</option>
<option value="91"> 1991</option>
<option value="92"> 1992</option>
<option value="93"> 1993</option>
<option value="94"> 1994</option>
<option value="95"> 1995</option>
<option value="96"> 1996</option>
<option value="97"> 1997</option>
<option value="98"> 1998</option>
<option value="99"> 1999</option>
<option value="2000"> 2000</option>
<option value="2001"> 2001</option>
<option value="2002"> 2002</option>
<option value="2003"> 2003</option>
<option value="2004"> 2004</option>
<option value="2005"> 2005</option>
<option value="2006"> 2006</option>
<option value="2007"> 2007</option>
<option value="2008"> 2008</option>
</select>
</td>
</tr>
<tr>
<tr>
<td>Edad:</td>
<td><input type="text" id="edad" name="edad" size="10" maxlength="2">
</td>
</tr>
</table>
</body>
</html>