struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vineith kaul <vine...@gmail.com>
Subject Re: Clear text while using File Upload in Struts2
Date Mon, 28 Dec 2009 16:11:00 GMT
If I understand your question right, I think a reset button should do the
job right ?

something like this:

<input type="reset"  value='Clear Input' name="reset1"
onclick="doReset(document.listForm);return false">

Vineith

On Mon, Dec 28, 2009 at 6:16 AM, Rafael Taboada
<kaliman.forever@gmail.com>wrote:

> Puedes usar javascript:
>
> function limpiarText(){
>   var idUpload=document.getElementById("idUpload");
>   var frm=document.getElementById("frm");
>   idUpload.setAttribute("value","");
>   frm.reset();
> }
>
>
> <s:form id="frm" action="doUploadFile" method="post"
> enctype="multipart/form-data">
>   <input name="upload" id="idUpload" type="file" class="file" size="1"
> onclick="limpiarText()" />
>       </s:form>
> On Mon, Dec 28, 2009 at 2:12 AM, Saeed Iqbal <saeedcs@gmail.com> wrote:
>
> > If you have not submitted the form and you want this functionality
> > then you are talking about ajax file upload
> >
> > struts doesnt provide ajax file upload but you can do that in struts
> > using other libraries
> >
> > On Monday, December 28, 2009, Mageshwaran <mageshwaran@dhyanit.com>
> wrote:
> > > I have not submitted the form.
> > > I just only selected the file using file dialog.
> > >
> > > It would be helpful if you give the code snippet to implement in Java
> > Script.
> > >
> > > Magesh.
> > >
> > >
> > > Saeed Iqbal wrote:
> > >
> > > It gets submitted after post
> > >
> > > if you want to clear maybe use javascript to clear
> > >
> > > On Monday, December 28, 2009, Mageshwaran <mageshwaran@dhyanit.com>
> > wrote:
> > >
> > >
> > > Hi All,
> > >        In my jsp code i had used "<s:file name="uploadFile"
> label="File"
> > size="20" onkeypress = "killEvent(event)"/>" for file upload using
> IFrame.
> > >
> > > The issue is if i select a file using file dialog, there is no option
> to
> > clear the selected text. Can any one help me how to clear the uploaded
> file
> > path text?
> > >
> > > Thanks in Advance,
> > > Magesh.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >  --
> > Saeed Iqbal
> > Independant Consultant
> > J2EE - Application Architect / Developer
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Rafael Taboada
> Software Engineer
>
> Cell : +511-992741026
>
> "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message