This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes type=file control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "type=file control " Watch "type=file control " New topic

type=file control

Ravi Shankar

Joined: Apr 07, 2003
Posts: 26
I would like to know how we can change the background color of the browse button for the INPUT type=file control.
Thanks in advance
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
I do not think it can be done from my knowledge of playing around with forms in the past.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60810

Eric is correct; it cannot be done. Which really really sucks because it makes it impossible to make the file control look like the rest of a web site design.
I have heard tell of someone putting the file contol in a hidden div and using other controls to emulate and control it through Javascript. I spent an afternoon a few months back trying to get something like this to work and was unsuccessful.
You might want to google around and see if you can find some info on this tactic.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: type=file control
Similar Threads
Selecting a Directory in Input type = file
Present User with Openfile Dialog Box
Folder Picker
Uploading both local and hosted files
File upload filter