🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.lenguajes.java
Article #661

Re: Resetear el valor del texto de Type="file"

#661
From: Paul
Date: Sun, 18 Feb 2007 15:09
68 lines
3171 bytes
On 18 feb, 15:53, "Paul" <gambam...@yahoo.es> wrote:
> On 18 feb, 13:42, Flint <dirfa...@terra.es> wrote:
>
>
>
>
>
> > Paul escribió:
>
> > > Hola,
>
> > > Tengo en HTML un formulario y dentro de este tengo:
> > > <input name="txtImg1" type="file" size="50" maxlength="100">, dode se
> > > selecciona el path de una imagen.
>
> > > Pero llega un momento que desearía inicializar el contenido del texto
> > > y limpiar su contenido, es decir, dejarlo vacío.
>
> > > Alguna idea?
>
> > > Gracias
>
> > Con javascript.
>
> > O bien recorres el formulario o, más fácil, le añades un atributo id así:
>
> >         <input name="txtImg1" id="txtImg1" type="file" size="50" maxlength="100">
>
> > De esa manera, donde te interese le añades el evento que dispara la
> > función javascript. Supongamos un botón que al pulsarlo limpie el contenido:
>
> > <input type ="button" onclick="limpiar()" value="Limpiar"/>
>
> > Y la función javascript sería tal que:
>
> > <script type="text/javascript">
> >         function limpiar(){
> >                 document.getElementById('txtImg1').value ='';
> >         }
> > </script>
>
> > --
> > Un saludo, Flint
> > Gijon Fortuna (773926)www.fibha.com
>
> Hola,
>
> Esto que me dices no me funciona si  type="file".
>
> Gracias- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Hola,
Primero que todo gracias por responderme.

Y no sabes si hay alguna manera de inicializar el valor si
type="file", como un reset() o algo parecido
Otra pregunta, hay alguna forma de sacar la ventana de examinar sin
ser del typo Type="file", lo digo pq así podría hacer un textbox
normal y luego un botón quee sólo hiciera el examinar.

Un saludo
Technical Details
Message-ID: <1171811366.843441.192470@s48g2000cws.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!s48g2000cws.googlegroups.com!not-for-mail
References: <1171800914.372856.123820@v45g2000cwv.googlegroups.com> <53qvtnF1u67mrU1@mid.individual.net> <1171810389.588026.290890@q2g2000cwa.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1116f3,488dfd7adce2523f
X-Google-Attributes: gid1116f3,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!s48g2000cws.googlegroups.com!not-for-mail
From: "Paul" <gambamia2@yahoo.es>
Newsgroups: es.comp.lenguajes.java
Subject: Re: Resetear el valor del texto de Type="file"
Date: 18 Feb 2007 07:09:26 -0800
Organization: http://groups.google.com
Lines: 69
Message-ID: <1171811366.843441.192470@s48g2000cws.googlegroups.com>
References: <1171800914.372856.123820@v45g2000cwv.googlegroups.com>
   <53qvtnF1u67mrU1@mid.individual.net>
   <1171810389.588026.290890@q2g2000cwa.googlegroups.com>
NNTP-Posting-Host: 85.50.66.32
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1171811381 7353 127.0.0.1 (18 Feb 2007 15:09:41 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 18 Feb 2007 15:09:41 +0000 (UTC)
In-Reply-To: <1171810389.588026.290890@q2g2000cwa.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: s48g2000cws.googlegroups.com; posting-host=85.50.66.32;
   posting-account=sJkUqQ0AAABRTeHFjYlHMV-CoFTNtaDQ