elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web (Moderador: #!drvy)
| | |-+  Que devuelve el <input type="file"> sin ningun fichero ???? (solucionado)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Que devuelve el <input type="file"> sin ningun fichero ???? (solucionado)  (Leído 5,054 veces)
-=[ §ÂßÂÑÐØ ]=-


Desconectado Desconectado

Mensajes: 857


[[CoNoCiMiEnTo Es PoDeR]]


Ver Perfil WWW
Que devuelve el <input type="file"> sin ningun fichero ???? (solucionado)
« en: 11 Mayo 2011, 17:35 pm »

Buenas,

Estoy haciendo un trabajo de javascript y tengo que controlar mediante un simple if si me meten un fichero  mediante un input file y necesito saber k devuelve sin ningun fichero...

el esquema a grandes rasgos es

<html>
<llamo al script externo>
<form>
<input type="file" id="fichero">
<input type="submit" onclick="validar()">
</form>
</html>


el script a grandes rasgos es....

<script>
var fichero=document.getElementById("fichero");
</script>

Si pongo un fichero y clicko en el boton se k devuelve la ruta.....

pero necesito controlar que no me hallan metido ningun fichero.....

he probado con undefined,nulll," ",...... y naaaaaaa alguna idea de k puede contener la variable fichero sin haber seleccionado anteriormente el fichero??

gracias de antemano!!


« Última modificación: 11 Mayo 2011, 17:44 pm por -=[ §ÂßÂÑÐØ ]=- » En línea

SALUDOS DE -=[ §AßAÑÐØ ]=-




-=[ §ÂßÂÑÐØ ]=-


Desconectado Desconectado

Mensajes: 857


[[CoNoCiMiEnTo Es PoDeR]]


Ver Perfil WWW
Re: Que devuelve el <input type="file"> sin ningun fichero ????
« Respuesta #1 en: 11 Mayo 2011, 17:44 pm »

Lo solucione gracias a la utilidad de chrome para javascript con el watchexpresions....

por si alguna vez alguien pregunta, se controla

if(fichero==false)

no se como no cai ...


En línea

SALUDOS DE -=[ §AßAÑÐØ ]=-




Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Duda sobre meta http-equiv="Content-Type" content="text/html; charset=utf-8"
Desarrollo Web
Hadess_inf 3 12,195 Último mensaje 22 Julio 2010, 06:44 am
por Morris
[AYUDA] "g++: error: CreateProcess: No such file or directory" « 1 2 »
Programación C/C++
Wofo 10 13,732 Último mensaje 28 Marzo 2013, 09:22 am
por Wofo
estilo a formulario <input type="text">[RESUELTO]
Desarrollo Web
basickdagger 1 1,904 Último mensaje 12 Septiembre 2014, 23:33 pm
por #!drvy
input type file no sube archivos
Desarrollo Web
gAb1 0 2,464 Último mensaje 7 Noviembre 2015, 05:41 am
por gAb1
[Resuelto] resetear/limpiar input type file on click
Desarrollo Web
gAb1 2 7,066 Último mensaje 11 Diciembre 2015, 18:51 pm
por gAb1
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines