Ver Mensaje Individual
  #7 (permalink)  
Antiguo 03/08/2012, 14:34
kfh1992
 
Fecha de Ingreso: diciembre-2011
Mensajes: 414
Antigüedad: 13 años, 2 meses
Puntos: 1
Respuesta: Introducir javascript en php

Hola,

Cita:
<form id="formu" name="form1" method="post" action="">
Nombre: <input name="name" type="text" id="name" size="18" />
Apellidos: <input name="surnamme" type="text" id="surname" size="18" />
<input type="button" value="Verificar" onclick="verificar();" />
</p>
</form>
<script type="text/javascript">
function verificar(){
if (document.forms["name"].elements["surname"].value=="")
{
alert("ERROR!!!\n\n El campo esta vacio.");
}
else
{ alert("CORRECTO!!!\n\n El campo esta cumplimentado.");
}}
</script>

De esta manera no me funciona TT'