Foros del Web » Programando para Internet » Javascript »

Ayuda Urgente Solo Para Expertos

Estas en el tema de Ayuda Urgente Solo Para Expertos en el foro de Javascript en Foros del Web. ALGUIEN PODRIA AYUDARME CON ESTE PROBLEMA? TENGO UNA CARPETA VIRTUAL EN MI SERVER LLAMADA "BMP" Y DENTRO TENGO SUB DIRECTORIOS LLAMADOS BMP1, BMP2, BMP3 HASTA ...
  #1 (permalink)  
Antiguo 10/06/2002, 10:05
 
Fecha de Ingreso: enero-2002
Mensajes: 10
Antigüedad: 22 años, 3 meses
Puntos: 0
Ayuda Urgente Solo Para Expertos

ALGUIEN PODRIA AYUDARME CON ESTE PROBLEMA?

TENGO UNA CARPETA VIRTUAL EN MI SERVER LLAMADA "BMP" Y DENTRO TENGO SUB DIRECTORIOS LLAMADOS BMP1, BMP2, BMP3 HASTA BMP8
LO QUE NECESITO ES BUSCAR UNA IMAGEN EN ESTAS CARPETAS QUE TIENEN POR NOMBRE FC + NUMERO DE DOCUMENTO + .GIF EL PRIMER NUMERO DEL DOCUMENTO INDICA EN QUE CARPETA ESTA EL ARCHIVO.
EJ. FC500106780.GIF ESTARIA EN LA CARPETA BMP5.
YO TENGO ESTE CODIGO PERO NO PUEDO HACER QUE BUSQUE EN LA CARPETA INDICADA. OSEA LO QUE QUIERO ES QUE SI EL PRIMER NUMERO ES 5 BUSQUE EN LA CARPETA 5 SI EL PRIMER NUMERO ES 3 BUSQUE EN LA CARPETA 3 CUANDO EL USUARIO COMPLETE UN FORMULARIO.

ESTE ES MI CODIGO.

<script language="JavaScript">
<!--
var nom
var dir="/Firmas-www/bmp/"
function cambiar() {
nom = document.formu.campo1.value
document.images.foto.src=dir+"fc"+nom+&q uot;.gif"
}
//-->
</script>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<!-- formulario para preguntar el numero de documento -->
<form method="post" name="formu">
<table width="698" border="0" cellspacing="3" cellpadding="5">
<tr>
<td width="698"><span class="comentario">INGRESE EL NUMERO DE CUENTA SIN
ESPACIOS.</span><br>
<input name="campo1" type="text" size="12" maxlength="12" onfinish="cambiar()">
<input name="button" type="button" class="boton" onClick="cambiar()" value="Buscar Firma">
</td>
</tr>
</table>
</form>
<!-- FIN DEL FORMULARIO -->
<!-- DONDE SE ESCRIBE LA IMAGEN -->
<img alt="" name="foto"><br>
<!-- FIN DE LA IMAGEN -->
  #2 (permalink)  
Antiguo 10/06/2002, 13:47
 
Fecha de Ingreso: febrero-2002
Mensajes: 127
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Ayuda Urgente Solo Para Expertos

Hola L@red, mira, he estado checkeando tu script y funciona perfectamente, el único problema que veo que puedes tener es la ruta, ya q el resto va muy bien. Prueba a poner como directorio de inicio la dirección http a ver si así te funciona.
Un saludo

Val Muñoz de Bustillo.<BR>
Todo sobre DHTML y javascript en <A HREF="http://www.iespana.es/topscripts">TopScripts</A>
  #3 (permalink)  
Antiguo 10/06/2002, 13:53
 
Fecha de Ingreso: enero-2002
Mensajes: 10
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Ayuda Urgente Solo Para Expertos

SI SE QUE FUNCIONA PASA QUE LO QUE NO HACE ES BUSCAR EN LOS SUB DIRECTORIOS BMP1, BMP2 BM3 ETC. NO SE SI ME EXPLICO?

GRACIAS!!
  #4 (permalink)  
Antiguo 10/06/2002, 14:15
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Re: Ayuda Urgente Solo Para Expertos

Hola,

prueba con esto:

&lt;script language=&quot;JavaScript&quot;&gt;
&lt;!--
var nom
var dir=&quot;/Firmas-www/bmp/&quot;
function cambiar() {
nom = document.formu.campo1.value
document.images.foto.src=dir+&quot;bmp&quot;+nom.charAt(0)+ &quot;/ fc&quot;+nom+&quot;.gif&quot;
}
//--&gt;
&lt;/script&gt;

Tal y como lo tienes no hace referencia a ningún subdirectorio.

A ver si así te funciona

suerte
  #5 (permalink)  
Antiguo 10/06/2002, 15:03
 
Fecha de Ingreso: febrero-2002
Mensajes: 127
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Ayuda Urgente Solo Para Expertos

claro, como bien dice tunait ¡¡¡No haces referencia a esos directorios!!! :D
Un saludo.


Val Muñoz de Bustillo.<BR>
Todo sobre DHTML y javascript en <A HREF="http://www.iespana.es/topscripts">TopScripts</A>
  #6 (permalink)  
Antiguo 10/06/2002, 15:11
 
Fecha de Ingreso: enero-2002
Mensajes: 10
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Ayuda Urgente Solo Para Expertos

MUCHAS GRACIAS FUNCIONA PERFECTO!!! <IMG SRC="images/futbol.gif" WIDTH="15" HEIGHT="15" HSPACE="3"> GRACIAS!!! UN ABRAZO!!!

NO DEJES DE PASAR POR <a href='ir.asp?http://www.lared.com.py' target='_blank'>http://www.lared.com.py...</a>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:22.