Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing text in file input

Status
Not open for further replies.

xwb

Programmer
Jul 11, 2002
6,828
GB
How do I change the text in file input.

<input type="file">

Gives a Browse... button.
How do I change Browse... to Upload...
 
There's no out-of-the-box way to do this, and the ways you can achieve it are not 100% cross-browser.

I suggest reading these:




Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Thanks BRPS. I sort of suspected that since I couldn't find anything on the W3C site.
 
There's very little you can do to affect the value of a file input, for reasons of security. If file inputs worked like normal ones, unscrupulous people could do things like this:
Code:
<input type="file" value="C:\something_important.txt" style="display:none">
Put that somewhere innocuous like a search or contact form, and the user is having files uploaded from his/her machine without knowing about it.

That doesn't help you olve your problem, but at least you know why it is how it is.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
I tend to agree with audiopro.
You "Browse" for the file first, and then you "Upload" it. So you could have a second button that says "Upload" that only becomes available when a file has been chosen, and submits the form so the file can be uploaded.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top