<input type="file" value="Browse" name="avatar" id="id_avatar" />
I tried to modify the value
, but it's not working. How to customize the button text?
<input type="file" value="Browse" name="avatar" id="id_avatar" />
I tried to modify the value
, but it's not working. How to customize the button text?
I think this is what you want:
Simply
[Edit with snippet]
if you using rails and have problem apply it, I would like to add some tips from original answer posted by @Fernando Kosh
open your application.js and add this line below
//= require bootstrap-filestyle.min
open your coffee and add this line
$(":file").filestyle({buttonName: "btn-primary",buttonBefore: true,buttonText: " Your text here",icon: false});
Use Bootstrap FileStyle, which is used to style the file fields of forms. It is a plugin for a jQuery-based component library called Twitter Bootstrap
Sample usage:
Include:
Via JavaScript:
Via data attributes:
JS
more http://geniuscarrier.com/how-to-style-a-html-file-upload-button-in-pure-css/
Only CSS & bootstrap class