Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/07/2012, 22:24
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Acceder a input dentro de una tabla

Por eso mismo te pregunto cual es el formato de Fecha, lo cual estás aclarando recien ahora

y si no entendiste mi ejemplo quizás esto te clarifique más, no es má que tu código
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. function edad(Fecha){
  9. fecha = new Date(Fecha);
  10. hoy = new Date();
  11. ed = parseInt((hoy -fecha)/365/24/60/60/1000);
  12. document.getElementById('pepe').value = "tienes " + ed + " años";
  13. document.getElementById('pepe2').value = "tienes " + ed + " años";
  14. }
  15. //]]>
  16. </head>
  17. id pepe 2<input type="text" id="pepe2" />
  18.   <table border="1">
  19. <tr>
  20.  <td>fecha<input type="text" name="textfield" onblur="edad(this.value)" /></td>
  21.  <td>edad<input type="text" name="pepe" id="pepe" /></td>
  22.  </tr>
  23.  </table>
  24. </body>
  25. </html>
Tomate el trabajo de ejecutarlo y vas a ver que los campos pepe / pepe2 se completan correctamente
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.