This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes how to reset the struts html file upload filed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to reset the struts html file upload filed?" Watch "how to reset the struts html file upload filed?" New topic
Author

how to reset the struts html file upload filed?

Pooja Karthik
Greenhorn

Joined: May 10, 2010
Posts: 5
Am trying to reset the struts html file upload filed. Am trying to set as "" or null by using javascript. But it is not working. Please let me know the solution.
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi there,
use
this works for me.
Pooja Karthik
Greenhorn

Joined: May 10, 2010
Posts: 5
Getting 0 is null or not an object error whil using the code.

Sanjeev Kumar Ramineni
Greenhorn

Joined: Jul 14, 2010
Posts: 12
Hi Pooja,

One solution to this problem is to reset the complete form by

document.forms[0].reset(); or document.formName.reset();

The other solution for the same is described in the link below

http://gusiev.com/2009/04/clear-upload-file-input-field/

Regards,
Sanjeev.
 
Don't get me started about those stupid light bulbs.
 
subject: how to reset the struts html file upload filed?
 
Similar Threads
REST Fileupload client
Uploading file
html:file
upload file question
Resource not found