This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:file tag and custom image" Watch "html:file tag and custom image" New topic

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;">


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

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

Consultant, Sima Solutions
I agree. Here's the link:
subject: html:file tag and custom image
It's not a secret anymore!