GeeCON Prague 2014*
The moose likes Struts and the fly likes html:file tag and custom image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:file tag and custom image" Watch "html:file tag and custom image" New topic
Author

html:file tag and custom image

Elie Hirschman
Ranch Hand

Joined: Dec 15, 2005
Posts: 37
Hi there!
I am newish to Struts and have not found a way to allow a custom image appear for the browse button when using in a form.
Here is the code I have tried in my jsp:


Can anyone help?
Elie Hirschman
Ranch Hand

Joined: Dec 15, 2005
Posts: 37
I could not accomplish this. So I gave up.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Here is a link to the same question posed in another forum. The respondent shows a clever way to do this. I haven't tried it, but you might want to give it a go.

Since you're using Struts, you could replace their line:

<input type="file" name="browse" style="display:none;">

with

<html:file property="theFile" style="display:none;" />

Just make sure you replace all references to "browse" in their javascript with "theFile".


Merrill
Consultant, Sima Solutions
 
 
subject: html:file tag and custom image