Ver Mensaje Individual
  #7 (permalink)  
Antiguo 21/02/2011, 16:17
matiasbmx
 
Fecha de Ingreso: febrero-2011
Mensajes: 124
Antigüedad: 13 años, 3 meses
Puntos: 4
Respuesta: Problema con validar campos de formulario

Cita:
Iniciado por _cronos2 Ver Mensaje
No hay body (a ver si no se me escapa ningún error más XD)
Le agregue el body quedandome asi el codigo:
Código PHP:
<html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
script/* Abrimos etiqueta de código */
function validar_formulario(){ /* Abrimos la función validar_formulario */
if (document.form1.titulo.value.length==0){
alert(“Debe ingresar un titulo”)
}
document.form1.titulo.focus()
return 
0;
}
</script>
</head>
<body>
<form name="form1" action="procesanoticia.php" method="post" onsubmit='return validar_formulario()'> 
Título noticia:<br> 
<input type="text" name="titulo"><br> 
Autor:<br> 
<input type="text" name="autor"><br> 
Categoría:<br> 
<input type="text" name="categoria"><br> 
Escriba el articulo<br> 
<textarea name="articulo" cols="50" rows="10"></textarea><br> 
<input type="submit" value="Publicar" />
</form>
</body>
</html> 
y no me funciono, sigue igual...