Tema: Formulario
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/04/2014, 04:01
Avatar de MaNuX0218
MaNuX0218
 
Fecha de Ingreso: marzo-2014
Mensajes: 787
Antigüedad: 10 años, 10 meses
Puntos: 67
Respuesta: Formulario

Código HTML:
Ver original
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Insertar.php</TITLE>
  4.  
  5. function myf()
  6. {
  7.  
  8.      window.alert(document.getElementById("nombre").value);
  9.    // window.alert("Hola mundo");
  10.        
  11. }
  12.  
  13.  
  14. <input type="text" name="nombre" id="nombre" maxlength="20" size="20" />
  15. <input type="text" name="nombre2" maxlength="20" size="20" />
  16. <input type="button" name="boton" value="Buscar" onclick="myf()" />
  17.  
  18. </HEAD>
  19. <BODY>
  20. <?
  21.  
  22.  
  23.  
  24. ?>
  25. </BODY>
  26. </HTML>

Te faltava asignarle el id en el input, pruebalo ahora.

Saludos.