Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/09/2006, 09:00
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola xandria

Un ejemplo sencillo:
Código PHP:
<html>
<
head>
<
script type="text/javascript">
function 
validar() {
  if (
document.forms[0]['txt'].value == '') {
    
alert('Escribe algo');
    return 
false;
  }
}
</script>
</head>
<body>
<form action="tupagina.php" onsubmit="return validar()">
<input type="text" name="txt" />
<input type="submit" />
</form>
</body>
</html> 
Saludos,