<div dir="ltr">Gracias Matias por la respuesta, voy a leer ese articulo, ya que me nombas la performance de la carga del sitio, tengo un problema que ya creo que es sobre mi maquina y algun script que una vez que carga el documento abajo de la etiqueta </html> se van creando etiquetas <img con el src de taringa turamix (o algo parecido) y algunos nombres mas, tendras idea el porque?<div>
<br></div><div>saludos</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/22 Matias Gea <span dir="ltr"><<a href="mailto:matigea@gmail.com" target="_blank">matigea@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hola, Leandro.<br>
<br>
Cuando llames a la función de validación recordá siempre poner el<br>
"return", así el formulario actúa de acuerdo a el valor que retorna la<br>
función:<br>
<br>
<form action="" method="post"  onsubmit="return validar()"><br>
<br>
Con respecto al css, fijate que tenés una barra al principio del url,<br>
lo que hace que te busque en la raíz del sitio, es decir, si estas<br>
trabajando en:<br>
<a href="http://localhost/miproyecto/index.php" target="_blank">http://localhost/miproyecto/index.php</a><br>
<br>
El css lo va a buscar a<br>
<a href="http://localhost/css/style.css" target="_blank">http://localhost/css/style.css</a><br>
<br>
Y calculo que la intención es<br>
<a href="http://localhost/miproyecto/css/style.css" target="_blank">http://localhost/miproyecto/css/style.css</a><br>
<br>
Probá eliminando la barra, para ofrecer una ruta relativa al archivo actual<br>
<div class="im"><br>
<style type="text/css" media="all"><br>
</div>@import url("css/style.css");<br>
</style><br>
<br>
<br>
Un detalle de performance: el comando import puede ser perjudicial<br>
para la optimización de la carga del sitio. Hay un muy buen artículo<br>
escrito por Steve Souders<br>
(<a href="http://www.stevesouders.com/blog/2009/04/09/dont-use-import/" target="_blank">http://www.stevesouders.com/blog/2009/04/09/dont-use-import/</a>) que<br>
explica esto muy bien, y su traducción por aNieto2K<br>
(<a href="http://www.anieto2k.com/2009/04/09/no-uses-import/" target="_blank">http://www.anieto2k.com/2009/04/09/no-uses-import/</a>). Recomiendo el<br>
original, que está más completo.<br>
<br>
Saludos!<br>
<br>
El día 20 de julio de 2013 19:44, leandro saubiette<br>
<<a href="mailto:saubietteleandro@gmail.com">saubietteleandro@gmail.com</a>> escribió:<br>
<div><div class="h5">> Buenas, tengo un formulario que no puedo validar mediante js comprobe las<br>
> rutas y estan bien definidas y el js teoricamente tmb aca lo paso<br>
><br>
> function validar ()<br>
> {<br>
> if(document.getElementById("nombre").value == null)<br>
> {<br>
> alert ("Debe ingresar un nombre valido");<br>
> return false;<br>
> }<br>
> if((document.getElementById('apellido').value) == "" ||<br>
> (is_numeric(document.getElementById('apellido'))))<br>
> {<br>
> alert ="Debe ingresar un apellido valido";<br>
> return false;<br>
> }<br>
> if(document.getElementById('dni').value == "")<br>
> {<br>
> alert ="Debe ingresar un dni valido valido";<br>
> return false;<br>
> }<br>
> if(document.getElementById('domicilio').value == "")<br>
> {<br>
> alert ="Debe ingresar un domicilio valido";<br>
> return false;<br>
> }<br>
> if((document.getElementById('mail').value) == "" ||<br>
> (is_numeric(document.getElementById('mail'))))<br>
> {<br>
> alert ="Debe ingresar un mail valido";<br>
> return false;<br>
> }<br>
> if(document.getElementById('telefono').value == "")<br>
> {<br>
> alert ="Debe ingresar un telefono valido";<br>
> return false;<br>
> }<br>
> return true;<br>
> }<br>
><br>
><br>
> todos los campos del formulario tienen un id y llamo a la funcion validar en<br>
> el evento onSubmit() en la etiqueta form de la siguiente manera <form<br>
> action="" method="post"  onsubmit="validar()"> lo que tmb me parece raro es<br>
> que no cargue el css. Aca paso el html del php<br>
><br>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br>
> "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"><br>
> <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"><br>
><br>
> <head><br>
><br>
> <meta http-equiv="X-UA-Compatible" content="IE=7" /><br>
><br>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br>
><br>
> <title> Centro cultural Juana Azurduy</title><br>
><br>
> <script type="text/javascript" src="/js/validarAsociado.js"></script><br>
><br>
> <style type="text/css" media="all"><br>
> @import url("/css/style.css");<br>
> </style><br>
><br>
> </head><br>
><br>
> <body><br>
><br>
> <div id="header"><br>
> <?php include '/header.php';?><br>
> </div><br>
><br>
><br>
> <form action="" method="post"  onsubmit="validar()"><br>
> <label>Nombre: </label><br>
> <input type="text" name="nombre" id="nombre"><br><br><br>
> <label>Apellido: </label><br>
> <input type="text" name="apellido" id="apellido"><br><br><br>
> <label>DNI: </label><br>
> <input type="text" name="dni" id="dni"><br><br><br>
> <label>Mail: </label><br>
> <input type="text" name="mail" id="mail"><br><br><br>
> <label>Direccion: </label><br>
> <input type="text" name="direccion" id="direccion"><br><br><br>
> <label>Telefono: </label><br>
> <input type="text" name="telefono" id="telefono"><br><br><br>
> <label>Fecha de Nacimiento: </label><br>
> <input type="text" name="fechaNac" id="fechaNac"><br><br><br>
> <select name="nivel"><br>
> <option value ='<?php echo $niveles['id'];?>'><?php echo<br>
> $niveles['nivel']?></option><br>
> </select><br><br><br>
> <input type="submit" name="agregar" value="agregar "id="agregar"><br>
> </form><br>
> <div id="footer"><br>
> <?php include '/footer.php';?><br>
> </div><br>
> </body><br>
> </html><br>
><br>
><br>
> Gracias por cualquier ayuda<br>
><br>
</div></div>> _______________________________________________<br>
> Php-avanzado mailing list<br>
> <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Matias Fernando Gea<br>
<a href="mailto:matigea@gmail.com">matigea@gmail.com</a><br>
<a href="http://www.mfgea.com.ar" target="_blank">http://www.mfgea.com.ar</a><br>
_______________________________________________<br>
Php-avanzado mailing list<br>
<a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
<a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
</font></span></blockquote></div><br></div>