views:

203

answers:

4

In HTML you can define in a form an input-field for uploading files. This input-field has a button attached, that pops up a file-chooser-dialog. How can I set the text for this button?

+1  A: 

You can't directly change it without some nifty CSS/JavaScript or using Flash.

roryf
that is not entirely true. You CAN work around it without flash, it just requires CSS and javascript.
Jeremy B.
+4  A: 

It involves a few hacks because browsers don't really want you to do it. Here is a nice tutorial on how to change the appearance and text of the browse button: Click here

Jeremy B.
This method may trigger a browser's clickjacking detection. http://en.wikipedia.org/wiki/Clickjacking
R. Bemrose
It is definitely not the most optimal solution, but to my knowledge it is the only way to get the browser to let you do anything to the file input.
Jeremy B.
A: 

Or you just give up and use something nice like SWFUpload. Why use all that faked overlay when you may as well just replace the upload altogether.

Damo
A: 

Similar question here: Setting uniform <input type=”file”> width in all browsers

Török Gábor