-3

How to rename the upload file button. I know how to style it, but rename the button is how?.

<input type="file" />

Thanks for the answer.

  • 1
    possible duplicate of [How to rename HTML "browse" button?](http://stackoverflow.com/questions/1163667/how-to-rename-html-browse-button) – Barmar Jul 26 '13 at 05:39
  • http://asp-net-example.blogspot.in/2009/01/aspnet-fileupload-example-how-to-rename.html – Falguni Panchal Jul 26 '13 at 05:41

5 Answers5

4

Not possible, but with a hack you can do it.

Eventhough you haven't tagged jQuery or Javascript, here I would like to present my idea using jQuery.

HTML:

<button id="hackIt">Upload</button>
<input type="file" />

CSS:

input[type='file'] {
    display: none;
}

JS:

$('#hackIt').on('click', function(){
$('input[type=file]').trigger('click');
});

Check this JSFiddle

asiby
  • 3,229
  • 29
  • 32
Praveen
  • 55,303
  • 33
  • 133
  • 164
1

You can change it by using something like value="Upload"

inspiredMichael
  • 370
  • 4
  • 9
0

there is no way u can change it you should use css hacks or javascript to create custom file button design

Hushme
  • 3,108
  • 1
  • 20
  • 26
0

Well, the short answer is - you can't! The text is predefined in the browser and is this way for security.

There are many ways to add different styles to the file select button using javascript/css, though. Just google something along the lines style file input button. You will most likely have to settle with an image for the button if you want to change the text.

Pankucins
  • 1,690
  • 1
  • 16
  • 25
0

Browse button is dependent on Browser. It display in different way in different browser.

You can make custom button to show different view in every browser Thanks

Ankit Jain
  • 1,226
  • 1
  • 10
  • 17