Ver Mensaje Individual
  #3 (permalink)  
Antiguo 25/07/2008, 22:37
Avatar de xbx
xbx
 
Fecha de Ingreso: mayo-2008
Ubicación: /home/xbx
Mensajes: 301
Antigüedad: 16 años
Puntos: 11
Respuesta: validar campos html??

A lo que se refiere Caricatos es a esto:

Código HTML:
<html>
<head>
 <script>
   function verifica()
{
if(document.test.nick.value == "")
{
alert("El campo nombre esta vacio");
 //y aqui viene la respuesta a tu pregunta
document.getElementById('nick').style.border = 'thin solid #FF0000';
  return false; //no se realiza el submit
}
else
{
 return true; //se realiza el submit
}
}

</script>

</head>


<body>
<form id="formulario" name="test" method="post" action="register.php" onsubmit="return verifica();">
   Nick:
      <input name="nick" type="text" id="nick" />
<input type="submit" value="Enviar">
</form>
</body> 
Cita:
//y aqui viene la respuesta a tu pregunta
Jajaja, esa linea viene de otro post verdad?

Un abrazo!